fixed more binutils issues (newer gcc/libc)
[zpugcc/jano.git] / toolchain / gcc / newlib / libm / mathfp / sf_isinf.c
blob84ab3f71c80da41c5b68a566cfda5de28c9f839b
2 /* @(#)z_isinff.c 1.0 98/08/13 */
3 /******************************************************************
4 * isinff
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 int
22 _DEFUN (isinff, (float),
23 float x)
25 __uint32_t wx;
26 int exp;
28 GET_FLOAT_WORD (wx, x);
29 exp = (wx & 0x7f800000) >> 23;
31 if ((exp == 0x7f8) && !(wx & 0xf0000))
32 return (1);
33 else
34 return (0);
37 #ifdef _DOUBLE_IS_32BITS
39 int
40 _DEFUN (isinf, (double),
41 double x)
43 return isinff ((float) x);
46 #endif /* defined(_DOUBLE_IS_32BITS) */