aboutsummaryrefslogtreecommitdiff
path: root/src/lib9/fmt
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2007-04-06 13:27:55 +0000
committerrsc <devnull@localhost>2007-04-06 13:27:55 +0000
commitada7ea055b221d489ebfbf2b2900b4e39f3fd043 (patch)
treeb78003cdc82b33a24105580cab7e700575821d42 /src/lib9/fmt
parentfdfecd686054be1aac715fb3b99669873df002bb (diff)
downloadplan9port-ada7ea055b221d489ebfbf2b2900b4e39f3fd043.tar.gz
plan9port-ada7ea055b221d489ebfbf2b2900b4e39f3fd043.tar.bz2
plan9port-ada7ea055b221d489ebfbf2b2900b4e39f3fd043.zip
another day, another __isNaN
Diffstat (limited to 'src/lib9/fmt')
-rw-r--r--src/lib9/fmt/nan64.c3
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