w_exp2l.c 579 B

123456789101112131415161718192021222324
  1. /*
  2. * wrapper exp2l(x)
  3. */
  4. #include <math.h>
  5. #include "math_private.h"
  6. #if !defined __NO_LONG_DOUBLE_MATH
  7. long double
  8. exp2l (long double x)
  9. {
  10. # if defined(__UCLIBC_HAS_FENV__)
  11. long double z = (long double) pow(2.0, (double) x);
  12. if (__builtin_expect (!isfinite (z) || z == 0, 0)
  13. && isfinite (x) && _LIB_VERSION != _IEEE_)
  14. /* exp2 overflow: 244, exp2 underflow: 245 */
  15. return __kernel_standard_l (x, x, 244 + !!signbit (x));
  16. return z;
  17. # else
  18. return (long double) pow(2.0, (double) x);
  19. # endif /* __UCLIBC_HAS_FENV__ */
  20. }
  21. #endif /* __NO_LONG_DOUBLE_MATH */