]>
Commit | Line | Data |
---|---|---|
601d2942 UD |
1 | /* |
2 | * wrapper log2(X) | |
3 | */ | |
4 | ||
5 | #include "math.h" | |
6 | #include "math_private.h" | |
7 | ||
8 | float | |
9 | __log2f (float x) /* wrapper log2f */ | |
10 | { | |
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) | |
18 | { | |
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); | |
25 | } | |
26 | else | |
27 | return z; | |
28 | #endif | |
29 | } | |
30 | weak_alias (__log2f, log2f) |