Avoid overflows from long double functions using __kernel_standard.
[glibc.git] / math / w_exp2l.c
blob7f06805a0dd030ce8f9f97f9f96cb260ea5cf77b
1 /*
2 * wrapper exp2l(x)
3 */
5 #include <math.h>
6 #include <math_private.h>
8 long double
9 __exp2l (long double x)
11 long double z = __ieee754_exp2l (x);
12 if (__builtin_expect (!__finitel (z), 0)
13 && __finitel (x) && _LIB_VERSION != _IEEE_)
14 /* exp2 overflow: 244, exp2 underflow: 245 */
15 return __kernel_standard_l (x, x, 244 + !!__signbitl (x));
17 return z;
19 weak_alias (__exp2l, exp2l)