diff options
author | rsc <devnull@localhost> | 2007-04-06 13:27:55 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2007-04-06 13:27:55 +0000 |
commit | ada7ea055b221d489ebfbf2b2900b4e39f3fd043 (patch) | |
tree | b78003cdc82b33a24105580cab7e700575821d42 /src | |
parent | fdfecd686054be1aac715fb3b99669873df002bb (diff) | |
download | plan9port-ada7ea055b221d489ebfbf2b2900b4e39f3fd043.tar.gz plan9port-ada7ea055b221d489ebfbf2b2900b4e39f3fd043.tar.bz2 plan9port-ada7ea055b221d489ebfbf2b2900b4e39f3fd043.zip |
another day, another __isNaN
Diffstat (limited to 'src')
-rw-r--r-- | src/lib9/fmt/nan64.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib9/fmt/nan64.c b/src/lib9/fmt/nan64.c index 8fad49eb..3a1f2111 100644 --- 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 |