Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libm / common / sf_isnan.c
blob5c611d67eb033a437d4d747b8dab7e79a44962a3
1 /* sf_c_isnan.c -- float version of s_c_isnan.c.
2 */
4 /*
5 * ====================================================
6 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
8 * Developed at SunPro, a Sun Microsystems, Inc. business.
9 * Permission to use, copy, modify, and distribute this
10 * software is freely granted, provided that this notice
11 * is preserved.
12 * ====================================================
16 * isnanf(x) returns 1 is x is nan, else 0;
18 * isnanf is an extension declared in <math.h>.
21 #include "fdlibm.h"
22 #include <ieeefp.h>
24 #undef isnanf
26 int
27 isnanf (float x)
29 __int32_t ix;
30 GET_FLOAT_WORD(ix,x);
31 ix &= 0x7fffffff;
32 return FLT_UWORD_IS_NAN(ix);
35 #ifdef _DOUBLE_IS_32BITS
37 #undef isnan
39 int
40 isnan (double x)
42 return isnanf((float) x);
45 #endif /* defined(_DOUBLE_IS_32BITS) */