(j3.2006) Signaling NaN
Fred J. Tydeman
tydeman
Fri Mar 11 17:19:03 EST 2011
These comments are based upon:
ftp://ftp.nag.co.uk/sc22wg5/N1801-N1850/N1830.
14.11.37 IEEE_VALUE #8 has:
Whenever IEEE_VALUE returns a signaling NaN, it is processor
dependent whether or not invalid is raised and processor dependent
whether or not the signaling NaN is converted into a quiet NaN.
To me, that allows four different behaviours, but only two of them
make sense:
-- return a signaling NaN without invalid raised
-- return a quiet NaN with invalid raised
C99 only supports quiet NaNs (we had too many issues and too little
payoff trying to do signaling NaNs then).
10.7.2.3.2 F editing #5 has:
An input field ...
* an optional sign, followed by the string 'NAN', optionally
followed by zero or more alphanumeric characters enclosed in
parentheses.
Printed page 461 in A.2 has: optional non-blank characters.
I believe that non-blank needs to be changed to alphanumeric.
10.7.2.3.2 F editing #8 has:
For an internal value that is an IEEE NaN, the output field
... followed by the letters 'NaN' and optionally followed by
... alphanumeric processor-dependent characters enclosed in
parentheses, ...
C99 also allows lower case letters, upper case letters, digits, and
underscore inside the parentheses.
We are considering for C three ways to do I/O of signaling NaN:
SNAN == would be invalid input to existing implementation
NANS == would be quiet nan with "S" as next unread character to
existing implementation
NAN(S == might conflict with existing practice, but least affect on
real world.
The first two have the optional '(alphanumeric chars)'. The third requires it.
The first two would not be compatible with Fortran.
The last could be compatible with Fortran.
Correct?
---
Fred J. Tydeman Tydeman Consulting
tydeman at tybor.com Testing, numerics, programming
+1 (775) 358-9748 Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.
More information about the J3
mailing list