1 /* Copyright (c) 2002-2006 Lucent Technologies; see LICENSE */
4 * 64-bit IEEE not-a-number routines.
5 * This is big/little-endian portable assuming that
6 * the 64-bit doubles and 64-bit integers have the
15 static uvlong uvnan = ((uvlong)0x7FF00000<<32)|0x00000001;
16 static uvlong uvinf = ((uvlong)0x7FF00000<<32)|0x00000000;
17 static uvlong uvneginf = ((uvlong)0xFFF00000<<32)|0x00000000;
19 /* gcc sees through the obvious casts. */
27 assert(sizeof(u.d) == sizeof(u.v));
39 assert(sizeof(u.d) == sizeof(u.v));
56 /* IEEE 754: exponent bits 0x7FF and non-zero mantissa */
57 return (x&uvinf) == uvinf && (x&~uvneginf) != 0;
63 return u2d(sign < 0 ? uvneginf : uvinf);
67 __isInf(double d, int sign)
73 return x==uvinf || x==uvneginf;