plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

commit ada7ea055b221d489ebfbf2b2900b4e39f3fd043
parent fdfecd686054be1aac715fb3b99669873df002bb
Author: rsc <devnull@localhost>
Date:   Fri,  6 Apr 2007 13:27:55 +0000

another day, another __isNaN

Diffstat:
Msrc/lib9/fmt/nan64.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib9/fmt/nan64.c b/src/lib9/fmt/nan64.c @@ -31,7 +31,8 @@ __isNaN(double d) p = &d; x = *(uvlong*)p; - return (ulong)((x>>52)&0x7FF)==0x7FF && !__isInf(d, 0); + /* IEEE 754: exponent bits 0x7FF and non-zero mantissa */ + return (x&uvinf) == uvinf && (x&~uvneginf) != 0; } double