TODO update
[libm] / src / math / logbl.c
1 #include <limits.h>
2 #include "libm.h"
3 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
4 long double logbl(long double x)
5 {
6         return logb(x);
7 }
8 #else
9 long double logbl(long double x)
10 {
11         int i = ilogbl(x);
12
13         if (i == FP_ILOGB0)
14                 return -1.0/fabsl(x);
15         if (i == FP_ILOGBNAN || i == INT_MAX)
16                 return x * x;
17         return i;
18 }
19 #endif