]>
Commit | Line | Data |
---|---|---|
650425ce UD |
1 | /* |
2 | * wrapper exp2(x) | |
3 | */ | |
4 | ||
9d13fb24 | 5 | #include <math.h> |
9277c064 | 6 | #include <math_private.h> |
813378e9 | 7 | #include <math-svid-compat.h> |
9ac44708 | 8 | #include <libm-alias-double.h> |
650425ce | 9 | |
c20a1056 SN |
10 | #if LIBM_SVID_COMPAT && (SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_29) \ |
11 | || defined NO_LONG_DOUBLE \ | |
12 | || defined LONG_DOUBLE_COMPAT) | |
650425ce | 13 | double |
c20a1056 | 14 | __exp2_compat (double x) |
650425ce | 15 | { |
0cb7efc5 | 16 | double z = __ieee754_exp2 (x); |
d81f90cc WD |
17 | if (__builtin_expect (!isfinite (z) || z == 0, 0) |
18 | && isfinite (x) && _LIB_VERSION != _IEEE_) | |
0ac5ae23 | 19 | /* exp2 overflow: 44, exp2 underflow: 45 */ |
d81f90cc | 20 | return __kernel_standard (x, x, 44 + !!signbit (x)); |
0ac5ae23 | 21 | |
0cb7efc5 | 22 | return z; |
650425ce | 23 | } |
c20a1056 SN |
24 | # if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_29) |
25 | compat_symbol (libm, __exp2_compat, exp2, GLIBC_2_1); | |
26 | # endif | |
27 | # ifdef NO_LONG_DOUBLE | |
28 | weak_alias (__exp2_compat, exp2l) | |
29 | # endif | |
30 | # ifdef LONG_DOUBLE_COMPAT | |
31 | /* Work around gas bug "multiple versions for symbol". */ | |
32 | weak_alias (__exp2_compat, __exp2_compat_alias) | |
33 | ||
34 | LONG_DOUBLE_COMPAT_CHOOSE_libm_exp2l ( | |
35 | compat_symbol (libm, __exp2_compat_alias, exp2l, FIRST_VERSION_libm_exp2l), ); | |
36 | # endif | |
650425ce | 37 | #endif |