quieten compiler warnings when __UCLIBC_HAS_FENV__ isn't defined
[uclibc-ng.git] / libm / w_exp2l.c
blob60652b124c257fca33536255695fb28af0a4db45
1 /*
2 * wrapper exp2l(x)
3 */
5 #include <math.h>
6 #include "math_private.h"
8 #if !defined __NO_LONG_DOUBLE_MATH
9 long double
10 exp2l (long double x)
12 # if defined(__UCLIBC_HAS_FENV__)
13 long double z = (long double) pow(2.0, (double) x);
14 if (__builtin_expect (!isfinite (z) || z == 0, 0)
15 && isfinite (x) && _LIB_VERSION != _IEEE_)
16 /* exp2 overflow: 244, exp2 underflow: 245 */
17 return __kernel_standard_l (x, x, 244 + !!signbit (x));
19 return z;
20 # else
21 return (long double) pow(2.0, (double) x);
22 # endif /* __UCLIBC_HAS_FENV__ */
24 #endif /* __NO_LONG_DOUBLE_MATH */