1 /* s_logbl.c -- long double version of s_logb.c.
2 * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz.
6 * ====================================================
7 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
9 * Developed at SunPro, a Sun Microsystems, Inc. business.
10 * Permission to use, copy, modify, and distribute this
11 * software is freely granted, provided that this notice
13 * ====================================================
17 * long double logbl(x)
18 * IEEE 754 logb. Included to pass IEEE test suite. Not recommend.
23 #include <math_private.h>
24 #include <math_ldbl_opt.h>
27 __logbl (long double x
)
33 EXTRACT_WORDS64 (hx
, xhi
);
34 hx
&= 0x7fffffffffffffffLL
; /* high |x| */
36 return -1.0 / fabs (x
);
37 if (hx
>= 0x7ff0000000000000LL
)
39 if (__glibc_unlikely ((rhx
= hx
>> 52) == 0))
41 /* POSIX specifies that denormal number is treated as
42 though it were normalized. */
43 rhx
-= __builtin_clzll (hx
) - 12;
45 return (long double) (rhx
- 1023);
48 long_double_symbol (libm
, __logbl
, logbl
);