fixes for host gcc 4.6.1
[zpugcc/jano.git] / toolchain / gcc / newlib / libm / mathfp / s_isinf.c
blobfe9f547990c2f6f29d47e5130d2219a6cdb3cfaa
2 /* @(#)z_isinf.c 1.0 98/08/13 */
3 /******************************************************************
4 * isinf
6 * Input:
7 * x - pointer to a floating point value
9 * Output:
10 * An integer that indicates if the number is infinite.
12 * Description:
13 * This routine returns an integer that indicates if the number
14 * passed in is infinite (1) or is finite (0).
16 *****************************************************************/
18 #include "fdlibm.h"
19 #include "zmath.h"
21 #ifndef _DOUBLE_IS_32BITS
23 int isinf (double x)
25 __uint32_t lx, hx;
26 int exp;
28 EXTRACT_WORDS (hx, lx, x);
29 exp = (hx & 0x7ff00000) >> 20;
31 if ((exp == 0x7ff) && ((hx & 0xf0000 || lx) == 0))
32 return (1);
33 else
34 return (0);
37 #endif /* _DOUBLE_IS_32BITS */