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 #ifdef _NEED_FLOAT64
12 
13 int
__fpclassify64(__float64 x)14 __fpclassify64 (__float64 x)
15 {
16   __uint32_t msw, lsw;
17 
18   EXTRACT_WORDS(msw,lsw,x);
19 
20   msw &= 0x7fffffff;
21   if (msw == 0x00000000 && lsw == 0x00000000)
22     return FP_ZERO;
23   else if (msw <= 0x000fffff)
24     /* zero is already handled above */
25     return FP_SUBNORMAL;
26   else if (msw <= 0x7fefffff)
27     return FP_NORMAL;
28   else if (msw == 0x7ff00000 && lsw == 0x00000000)
29     return FP_INFINITE;
30   else
31     return FP_NAN;
32 }
33 
34 _MATH_ALIAS_i_d(__fpclassify)
35 
36 #endif /* _NEED_FLOAT64 */
37