(j3.2006) Signaling NaN
Tobias Burnus
burnus
Fri Mar 11 12:45:11 EST 2011
On 03/11/2011 06:19 PM, Bill Long wrote:
> The standard does specify some of this, and other parts are "processor
> dependent".
Well, I think it specifies the general format: A NaN is printed. And as
one can deduce from the input format, a signalling NaN, if printed as
such, has the format "NaN(" + some non-zero-sized string + ")". (Though,
the reverse does not work: If there are alphanumeric letters between the
"()", it can still be a quiet NaN.)
> Note that the standard (inconsistently) requires that on INPUT, the
> text is expected to be "NAN"
No, it does not: "A lower-case letter is equivalent to the corresponding
upper-case letter in an IEEE exceptional specification or the exponent
in a numeric input field."
> and on output it is "NaN". We print NAN on output so is consistent
> with input expectations.
While we (gfortran) print "NaN". (Ignoring the issue that gfortran still
lacks an implementation of the TR 15580/Fortran 2008 IEEE modules.)
Tobias
More information about the J3
mailing list