tanother day, another __isNaN - plan9port - [fork] Plan 9 from user space
HTML git clone git://src.adamsgaard.dk/plan9port
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit ada7ea055b221d489ebfbf2b2900b4e39f3fd043
DIR parent fdfecd686054be1aac715fb3b99669873df002bb
HTML Author: rsc <devnull@localhost>
Date: Fri, 6 Apr 2007 13:27:55 +0000
another day, another __isNaN
Diffstat:
M src/lib9/fmt/nan64.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
DIR diff --git a/src/lib9/fmt/nan64.c b/src/lib9/fmt/nan64.c
t@@ -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