1 /*
2  * wrapper exp2l(x)
3  */
4 
5 #include <math.h>
6 #include "math_private.h"
7 
8 #if !defined __NO_LONG_DOUBLE_MATH
9 long double
exp2l(long double x)10 exp2l (long double x)
11 {
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));
18 
19   return z;
20 # else
21   return (long double) pow(2.0, (double) x);
22 # endif /* __UCLIBC_HAS_FENV__ */
23 }
24 #endif /* __NO_LONG_DOUBLE_MATH */
25