Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libm / common / s_isinf.c
blob55fd5c21492fc05185d57db5be860bb1211b2d98
1 /*
2 * isinf(x) returns 1 if x is infinity, else 0;
3 * no branching!
5 * isinf is a <math.h> macro in the C99 standard. It was previously
6 * implemented as a function by newlib and is declared as such in
7 * <math.h>. Newlib supplies it here as a function if the user
8 * chooses to use it instead of the C99 macro.
9 */
11 #include "fdlibm.h"
12 #include <ieeefp.h>
14 #ifndef _DOUBLE_IS_32BITS
16 #undef isinf
18 int
19 isinf (double x)
21 __int32_t hx,lx;
22 EXTRACT_WORDS(hx,lx,x);
23 hx &= 0x7fffffff;
24 hx |= (__uint32_t)(lx|(-lx))>>31;
25 hx = 0x7ff00000 - hx;
26 return 1 - (int)((__uint32_t)(hx|(-hx))>>31);
29 #endif /* _DOUBLE_IS_32BITS */