Mail Archives: djgpp-workers/2000/03/22/12:29:06
On 22 Mar 00, at 15:44, Hans-Bernhard Broeker wrote:
[I added four zeroes in the next two lines]
> > > pos_nanshort = 7fff 0001 0000 0000 0000
> > > neg_nanshort = ffff 0001 0000 0000 0000
[...]
> So they are 'Pseudo-NaN', in the sense that they look a bit like NaN,
> but aren't, as they do not have the leading '1' bit in the mantissa
> required for NaNs, or any number that is not an unnormal.
I admit, that I have chosen the example numbers very unluckily. I
just wanted to show, that you can use the casting method to load
such numbers into an FPU register. I apologize for giving wrong
information.
That I thought, that these numbers are "normal" NaNs comes from the
reading of a paper by David Goldberg (What every Computer Scientist
should know about Floating-Point Aritmetic). In this paper he
defines a IEEE NaN as any number with an exponent of emax+1 and any
non-zero mantissa. I think David Goldberg was working on the IEEE
standards, so I trusted this definition.
Anyway, to be in conformance with C99 for printf, and to be
consistant with copysign and signbit, I think for NaNs (quiet and
signalling) and also for pseudo NaNs, printf should print [-]NAN.
For unnormals, it could print [-]NAN(unnormal) or [-]NAN.
BTW. Does anybody understand, what pseudo Infinities are?
(Described in the Intel manual under 7.4.4)
Regards,
Dieter
- Raw text -