ETSI's Bug Tracker - Part 01: TTCN-3 Core Language
View Issue Details
0006695Part 01: TTCN-3 Core LanguageClarificationpublic04-03-2014 16:4906-01-2015 19:10
Jacob Wieland - Spirent 
Gyorgy Rethy 
normalminoralways
closedfixed 
v4.5.1 (published 2013-04) 
v4.7.1 (published 2015-06)v4.7.1 (published 2015-06) 
7.1.1
Testing Technologies - Jacob Wieland
0006695: restriction on arithmetic operators should be put in a restriction section or should be dropped altogether
the restriction on the arithmetic float operators are only mentioned in a NOTE, but not in a proper restriction.

It is unclear why these restrictions exist in the first place as in other languages, clear semantics of using the special values as operands exist:

Infinity * -Infinity == -Infinity
Infinity * Infinity == Infinity
-Infinity * -Infinity == Infinity
Infinity * positive_number == Infinity
Infinity * 0.0 == NaN
Infinity * negative_number == -Infinity
-Infinity * positive_number == -Infinity
-Infinity * 0.0 == NaN
-Infinity * negative_number == Infinity
X * NaN == NaN
Infinity / (Infinity or NaN or -Infinity) == NaN
Infinity / positive_number == Infinity
Infinity / negative_number == -Infinity
-Infinity / positive_number == -Infinity
-Infinity / negative_number == Infinity
-Infinity / (Infinity or NaN or -Infinity) == NaN
(Infinity or NaN or -Infinity) / Infinity == NaN
(Infinity or NaN or -Infinity) / -Infinity == NaN
NaN / X == NaN
X / NaN == NaN

Therefore, I think the restriction should be dropped.


No tags attached.
docx CR6695_update_proposal.docx (14,971) 10-04-2014 14:54
http://oldforge.etsi.org/mantis/file_download.php?file_id=3006&type=bug
docx CR6695_update_proposal-v3.docx (13,695) 07-10-2014 15:57
http://oldforge.etsi.org/mantis/file_download.php?file_id=3103&type=bug
Issue History
04-03-2014 16:49Jacob Wieland - SpirentNew Issue
07-04-2014 16:46Gyorgy RethyNote Added: 0011947
07-04-2014 16:57Gyorgy RethyAssigned To => Axel Rennoch
07-04-2014 16:57Gyorgy RethyStatusnew => assigned
10-04-2014 14:54Axel RennochFile Added: CR6695_update_proposal.docx
10-04-2014 14:55Axel RennochAssigned ToAxel Rennoch => Gyorgy Rethy
10-04-2014 14:58Axel RennochNote Added: 0012012
10-04-2014 14:58Axel RennochStatusassigned => confirmed
20-06-2014 11:40Gyorgy RethyProjectTTCN-3 Change Requests => Part 01: TTCN-3 Core Language
20-06-2014 11:40Gyorgy RethyProduct Version => v4.5.1 (published 2013-04)
20-06-2014 11:40Gyorgy RethyTarget Version => v4.7.1 (published 2015-06)
06-10-2014 10:24Gyorgy RethyNote Added: 0012219
06-10-2014 10:24Gyorgy RethyNote Edited: 0012219bug_revision_view_page.php?bugnote_id=12219#r67
06-10-2014 10:24Gyorgy RethyNote Edited: 0012219bug_revision_view_page.php?bugnote_id=12219#r68
06-10-2014 12:01Jacob Wieland - SpirentNote Added: 0012228
06-10-2014 15:38Gyorgy RethyNote Added: 0012233
06-10-2014 15:39Gyorgy RethyAssigned ToGyorgy Rethy => Jens Grabowski
07-10-2014 15:57Jens GrabowskiFile Added: CR6695_update_proposal-v3.docx
07-10-2014 15:57Jens GrabowskiAssigned ToJens Grabowski => Gyorgy Rethy
07-10-2014 15:57Jens GrabowskiStatusconfirmed => assigned
07-10-2014 15:57Jens GrabowskiStatusassigned => resolved
07-10-2014 15:57Jens GrabowskiResolutionopen => fixed
06-01-2015 19:10Gyorgy RethyNote Added: 0012658
06-01-2015 19:10Gyorgy RethyStatusresolved => closed
06-01-2015 19:10Gyorgy RethyFixed in Version => v4.7.1 (published 2015-06)

Notes
(0011947)
Gyorgy Rethy   
07-04-2014 16:46   
stf478: check how operations are handled in other languages.
(0012012)
Axel Rennoch   
10-04-2014 14:58   
Problem: a note prevents arithmetic float operators for special float values infinity, -infinity and not_a_number



Analysis:
a) IEEE 754:2008 standard allow operation (ch 6.1):

Infinity * -Infinity == -Infinity
Infinity * Infinity == Infinity
-Infinity * -Infinity == Infinity
Infinity * positive_number == Infinity
Infinity * negative_number == -Infinity
-Infinity * positive_number == -Infinity
-Infinity * negative_number == Infinity
Infinity / positive_number == Infinity
Infinity / negative_number == -Infinity
-Infinity / positive_number == -Infinity
-Infinity / negative_number == Infinity


b) IEEE 754:2008 standard defines exceptions (i.e. invalid_operation=NaN, 7.1):

Infinity * 0.0 == NaN
-Infinity * 0.0 == NaN
X * NaN == NaN
Infinity / (Infinity or NaN or -Infinity) == NaN
-Infinity / (Infinity or NaN or -Infinity) == NaN
(Infinity or NaN or -Infinity) / Infinity == NaN
(Infinity or NaN or -Infinity) / -Infinity == NaN
NaN / X == NaN
X / NaN == NaN
(0012219)
Gyorgy Rethy   
06-10-2014 10:24   
Using float in TTCN-3 is twofold:
- they are data sent in message fields (e.g. signal strength in dB); in this context special values can also appear
- used as numbers in the TTCN-3 code (behaviour), e.g. timer values and durations (delays), calculating averages etc. In this context operations make sense, but using special values make not.

We have to decide which way to go: making the note a mandatory text or allow operations an special values?

*It needs STF discussion*

(0012228)
Jacob Wieland - Spirent   
06-10-2014 12:01   
Treating them differently would be confusing, I think.
(0012233)
Gyorgy Rethy   
06-10-2014 15:38   
Add a sentence that operations of IEEE 754 to be followed.
(0012658)
Gyorgy Rethy   
06-01-2015 19:10   
Added to draft V4.6.3