linux-mips
[Top] [All Lists]

NAN

To: shaver@netscape.com
Subject: NAN
From: ralf@uni-koblenz.de
Date: Sat, 11 Jul 1998 21:10:54 +0200
Cc: linux@cthulhu.engr.sgi.com
Sender: owner-linux@cthulhu.engr.sgi.com
I looked about around and found comments in some source code that according
to IEEE 754 apparently the result of converting a NAN to an integer is
unspecified.

I wrote a small test program that casts a double NAN into unsigned int.
On Linux/i386 + GNU libc the result is zero.  An equivalent program
running under IRIX returns MAXINT, that's 2^31 - 1.

Since even making the aliens land on earth would be a strictly IEEE 754
conformant result or maybe somewhat closer to the reality, treating the
conversion operation as a nop therefore probably resulting in a random
result, I think the part of Mozilla which dies is buggy and should be fixed.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>
  • NAN, ralf <=