Mail Archives: djgpp-workers/2000/03/19/11:51:06
According to Eli Zaretskii:
> > The C99 explicitly mentions signs of NaNs in its output specification for
> > *printf(), and also in strtod()/*scanf() input. I don't think we can just
> > say the a NaN with the sign bit set is *not* negative.
>
> I think we can, since the sign bit of a NaN is not an indication of
> it's being negative, when the real indefinite is concerned.
My reading of the standard says the sign of a negative NaN should be
printed. Nowhere it says we are allowed not to print it.
When the standard say e. g. "[-]nan" it also says "[-]ddd.ddd" for
ordinary numbers. This means (to me) that NaNs should be treated as
ordinary numbers as far as the sign is concerned. This means (to me)
that the "[-]" isn't optional, it's just short-hand for "print the
sign if it's negative".
Please read the standard and form your own opinion.
Bay Laurel, Days of Joy,
MartinS
- Raw text -