another day, another __isNaN

This commit is contained in:
rsc 2007-04-06 13:27:55 +00:00
parent fdfecd6860
commit ada7ea055b

View file

@ -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