2 * ====================================================
3 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 * Developed at SunPro, a Sun Microsystems, Inc. business.
6 * Permission to use, copy, modify, and distribute this
7 * software is freely granted, provided that this notice
9 * ====================================================
14 * IEEE 754 logb. Included to pass IEEE test suite. Not recommend.
21 #include "math_private.h"
24 two54 = 1.80143985094819840000e+16; /* 43500000 00000000 */
30 EXTRACT_WORDS(ix,lx,x);
31 ix &= 0x7fffffff; /* high |x| */
32 if((ix|lx)==0) return -1.0/fabs(x);
33 if(ix>=0x7ff00000) return x*x;
35 x *= two54; /* convert subnormal x to normal */
38 return (double) ((ix>>20)-1023-54);
40 return (double) ((ix>>20)-1023);
43 #if (LDBL_MANT_DIG == 53)
44 __weak_reference(logb, logbl);