[BZ #5112]
[glibc/pb-stable.git] / math / w_log2f.c
blobec8d2971612b1b8470404438956048d8f3709f65
1 /*
2 * wrapper log2(X)
3 */
5 #include <math.h>
6 #include "math_private.h"
8 float
9 __log2f (float x) /* wrapper log2f */
11 #ifdef _IEEE_LIBM
12 return __ieee754_log2f (x);
13 #else
14 float z;
15 z = __ieee754_log2f (x);
16 if (_LIB_VERSION == _IEEE_ || __isnanf (x)) return z;
17 if (x <= 0.0f)
19 if (x == 0.0f)
20 /* log2f (0) */
21 return __kernel_standard ((double) x, (double) x, 148);
22 else
23 /* log2f (x < 0) */
24 return __kernel_standard ((double) x, (double) x, 149);
26 else
27 return z;
28 #endif
30 weak_alias (__log2f, log2f)