]> git.ipfire.org Git - thirdparty/glibc.git/blame - math/w_log2.c
Use private math_private.h in files in math/
[thirdparty/glibc.git] / math / w_log2.c
CommitLineData
601d2942
UD
1/*
2 * wrapper log2(X)
3 */
4
9d13fb24 5#include <math.h>
9277c064 6#include <math_private.h>
601d2942
UD
7
8double
9__log2 (double x) /* wrapper log2 */
10{
11#ifdef _IEEE_LIBM
12 return __ieee754_log2 (x);
13#else
14 double z;
15 z = __ieee754_log2 (x);
16 if (_LIB_VERSION == _IEEE_ || __isnan (x)) return z;
17 if (x <= 0.0)
18 {
19 if (x == 0.0)
20 return __kernel_standard (x, x, 48); /* log2 (0) */
21 else
22 return __kernel_standard (x, x, 49); /* log2 (x < 0) */
23 }
24 else
25 return z;
26#endif
27}
28weak_alias (__log2, log2)
29#ifdef NO_LONG_DOUBLE
30strong_alias (__log2, __log2l)
31weak_alias (__log2, log2l)
32#endif