Mail Archives: djgpp-workers/2000/03/20/09:20:56
On Fri, 17 Mar 2000, Eric Rudd wrote:
> Hans-Bernhard Broeker wrote:
> There is the cryptic statement in the Pentium Pro manual, vol. 2, 7.6:
>
> "The sign bit of a NaN is not interpreted."
>
> What do you suppose they mean by that?
Without some more context, I'ld have to guess wildly. I prefer not to do
that, unless there's nothing else left to do...
> > 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.
>
> Yes, by footnote 220
>
> 7.19.6.1 Library 7.19.6.1
>
> 220When applied to infinite and NaN values, the -, +, and
> space flag characters have their usual meaning; the # and
> 0 flag characters have no effect.
This, being a footnote, is not 'normative', so it doesn't mean anything of
consequence. The explanation of the '+' option, however, does. Curiously
enough, that's the single place in the document I could find where the
behaviour of the optional minus sign is explicitly defined, for the case
where the "+" option is not given.
So the central question remains this one:
Is a NaN with the sign bit to be considered 'negative',
in terms of the C99 document, or not.
My point of view: Yes, it is negative. If not by setting the sign bit,
what *else* could make a NaN negative? Or, if no NaN can ever be negative,
why would C99 explicitly allow output like "-nan", in the first place?
Eli's point of view, as I read it: No, it is not negative, because the
term 'negative' does not have a valid mathematical meaning for NaNs.
My point against this reasoning by Eli is that the word 'negative', if
found in the C99 standard, does not necessarily mean the same as the word
'negative' in mathematics. Particularly in the case of NaNs, which live
completely outside the realm of analysis and algebra, such mathematical
arguments don't really count.
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -