include/elf.h: sync with GNU C library
[uclibc-ng.git] / libm / w_exp2f.c
blob0bb57878b65c42358f6eb8778198567d621d06ce
1 /*
2 * wrapper exp2f(x)
3 */
5 #include <math.h>
6 #include "math_private.h"
8 float
9 exp2f (float x)
11 #if defined(__UCLIBC_HAS_FENV__)
12 float z = (float) pow(2.0, (double) x);
13 if (__builtin_expect (!isfinite (z) || z == 0, 0)
14 && isfinite (x) && _LIB_VERSION != _IEEE_)
15 /* exp2 overflow: 144, exp2 underflow: 145 */
16 return __kernel_standard_f (x, x, 144 + !!signbit (x));
18 return z;
19 #else
20 return (float) pow(2.0, (double) x);
21 #endif