1 /* Copyright (C) 2002,2007 by  Red Hat, Incorporated. All rights reserved.
2  *
3  * Permission to use, copy, modify, and distribute this software
4  * is freely granted, provided that this notice is preserved.
5  */
6 
7 #define _ADD_D_TO_DOUBLE_FUNCS
8 
9 #include "fdlibm.h"
10 
11 int
__fpclassifyf(float x)12 __fpclassifyf (float x)
13 {
14   __uint32_t w;
15 
16   GET_FLOAT_WORD(w,x);
17 
18   if (w == 0x00000000 || w == 0x80000000)
19     return FP_ZERO;
20   else if ((w >= 0x00800000 && w <= 0x7f7fffff) ||
21            (w >= 0x80800000 && w <= 0xff7fffff))
22     return FP_NORMAL;
23   else if ((w >= 0x00000001 && w <= 0x007fffff) ||
24            (w >= 0x80000001 && w <= 0x807fffff))
25     return FP_SUBNORMAL;
26   else if (w == 0x7f800000 || w == 0xff800000)
27     return FP_INFINITE;
28   else
29     return FP_NAN;
30 }
31 
32 _MATH_ALIAS_i_f(__fpclassify)
33