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 int
__fpclassifyl(long double x)8 __fpclassifyl (long double x)
9 {
10 u_int32_t hx,lx,esx;
11
12 GET_LDOUBLE_WORDS(esx,hx,lx,x);
13
14 esx &= 0x7fff;
15 if (esx == 0 && hx == 0 && lx == 0)
16 return FP_ZERO;
17 else if (esx == 0)
18 /* zero is already handled above */
19 return FP_SUBNORMAL;
20 else if (esx < 0x7fff)
21 return FP_NORMAL;
22 else if (hx == LDBL_NBIT && lx == 0)
23 return FP_INFINITE;
24 else
25 return FP_NAN;
26 }
27
28