------- Comment #23 from burnus at gcc dot gnu dot org  2008-10-31 13:10 -------
> > in any case NaN can be unambiguously converted from one real/complex to 
> > another real/complex kind.
> 
> I disagree with the last sentence since there in not a single (or dual if you
> take into account signaling NaN's) NaN entity, but a whole class of them.

Still IEEE 754-2008 defines what a signalling/quiet NaN is; with regards to a
programmer, "NaN" is "NaN" and the exact bit pattern should not matter; and for
qNaN and sNaN - if you don't have IEEE trapping turned on, you effectively have
a quiet NaN in either case. Independent of the bit pattern "x /= x" is always
true if x is NaN and if x is NaN, y = x*5 will assign "NaN" to y. Thus I don't
see any ambiguity.

> I have never read anything about the reasons for having such a wide class of
> NaN's nor seen any use of it (even the use of quiet/signaling NaN's is quite
> fuzzy in most compiler implementation).

Interestingly, IEEE 754-1985 did not specify qNaN vs. sNaN but only "NaN"
(contrary to hardware, which supports both since a long time). With the new
IEEE 754-2008 both are defined and there is also more about the bit pattern.

See: IEEE section at http://gcc.gnu.org/wiki/GFortranStandards (especially the
last item if your place does not have an IEEE subscription).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37930

Reply via email to