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 int64_t hx; 11 u_int64_t lx; 12 13 GET_LDOUBLE_WORDS64(hx, lx, x); 14 15 hx &= 0x7fffffffffffffffLL; 16 17 if (hx == 0 && lx == 0) 18 return FP_ZERO; 19 else if (hx <= 0x0000ffffffffffffLL) 20 /* zero is already handled above */ 21 return FP_SUBNORMAL; 22 else if (hx <= 0x7ffeffffffffffffLL) 23 return FP_NORMAL; 24 else if (hx == 0x7fff000000000000LL && lx == 0) 25 return FP_INFINITE; 26 else 27 return FP_NAN; 28 } 29 30