OSDN Git Service

Merge branch 'master' of git://github.com/monaka/binutils
[pf3gnuchains/pf3gnuchains3x.git] / newlib / libm / common / sf_isinf.c
1 /*
2  * isinff(x) returns 1 if x is +-infinity, else 0;
3  *
4  * isinf is a <math.h> macro in the C99 standard.  It was previously
5  * implemented as isinf and isinff functions by newlib and are still declared
6  * as such in <ieeefp.h>.  Newlib supplies it here as a function if the user
7  * chooses to use <ieeefp.h> or needs to link older code compiled with the
8  * previous <math.h> declaration.
9  */
10
11 #include "fdlibm.h"
12 #include <ieeefp.h>
13
14 #undef isinff
15
16 int
17 _DEFUN (isinff, (x),
18         float x)
19 {
20         __int32_t ix;
21         GET_FLOAT_WORD(ix,x);
22         ix &= 0x7fffffff;
23         return FLT_UWORD_IS_INFINITE(ix);
24 }
25
26 #ifdef _DOUBLE_IS_32BITS
27
28 #undef isinf
29
30 int
31 _DEFUN (isinf, (x),
32         double x)
33 {
34         return isinff((float) x);
35 }
36
37 #endif /* defined(_DOUBLE_IS_32BITS) */