w_expl_compat.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* w_expl.c -- long double version of w_exp.c.
  2. * Conversion to long double by Ulrich Drepper,
  3. * Cygnus Support, drepper@cygnus.com.
  4. */
  5. /*
  6. * ====================================================
  7. * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  8. *
  9. * Developed at SunPro, a Sun Microsystems, Inc. business.
  10. * Permission to use, copy, modify, and distribute this
  11. * software is freely granted, provided that this notice
  12. * is preserved.
  13. * ====================================================
  14. */
  15. #if defined(LIBM_SCCS) && !defined(lint)
  16. static char rcsid[] = "$NetBSD: $";
  17. #endif
  18. /*
  19. * wrapper expl(x)
  20. */
  21. #include <math.h>
  22. #include <math_private.h>
  23. #include <math-svid-compat.h>
  24. #include <libm-alias-ldouble.h>
  25. #if LIBM_SVID_COMPAT
  26. long double __expl(long double x) /* wrapper exp */
  27. {
  28. # ifdef _IEEE_LIBM
  29. return __ieee754_expl(x);
  30. # else
  31. long double z = __ieee754_expl (x);
  32. if (__glibc_unlikely (!isfinite (z) || z == 0)
  33. && isfinite (x) && _LIB_VERSION != _IEEE_)
  34. return __kernel_standard_l (x, x, 206 + !!signbit (x));
  35. return z;
  36. # endif
  37. }
  38. libm_hidden_def (__expl)
  39. libm_alias_ldouble (__exp, exp)
  40. #endif