]> git.ipfire.org Git - thirdparty/glibc.git/blob - math/w_exp2_compat.c
a4d46537085640ed3f8cd9d1b7af109afff97d60
[thirdparty/glibc.git] / math / w_exp2_compat.c
1 /*
2 * wrapper exp2(x)
3 */
4
5 #include <math.h>
6 #include <math_private.h>
7 #include <math-svid-compat.h>
8
9 double
10 __exp2 (double x)
11 {
12 double z = __ieee754_exp2 (x);
13 if (__builtin_expect (!isfinite (z) || z == 0, 0)
14 && isfinite (x) && _LIB_VERSION != _IEEE_)
15 /* exp2 overflow: 44, exp2 underflow: 45 */
16 return __kernel_standard (x, x, 44 + !!signbit (x));
17
18 return z;
19 }
20 weak_alias (__exp2, exp2)
21 #ifdef NO_LONG_DOUBLE
22 strong_alias (__exp2, __exp2l)
23 weak_alias (__exp2, exp2l)
24 #endif