Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libm / common / sf_fpclassify.c
blob878457f39f7ad7b4d41f73077276b7c9e6b1dc1e
1 /* Copyright (C) 2002,2007 by Red Hat, Incorporated. All rights reserved.
3 * Permission to use, copy, modify, and distribute this software
4 * is freely granted, provided that this notice is preserved.
5 */
7 #include "fdlibm.h"
9 int
10 __fpclassifyf (float x)
12 __uint32_t w;
14 GET_FLOAT_WORD(w,x);
16 if (w == 0x00000000 || w == 0x80000000)
17 return FP_ZERO;
18 else if ((w >= 0x00800000 && w <= 0x7f7fffff) ||
19 (w >= 0x80800000 && w <= 0xff7fffff))
20 return FP_NORMAL;
21 else if ((w >= 0x00000001 && w <= 0x007fffff) ||
22 (w >= 0x80000001 && w <= 0x807fffff))
23 return FP_SUBNORMAL;
24 else if (w == 0x7f800000 || w == 0xff800000)
25 return FP_INFINITE;
26 else
27 return FP_NAN;