w_lgammal_r_compat.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* w_lgammal_r.c -- long double version of w_lgamma_r.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. /*
  16. * wrapper long double lgammal_r(long double x, int *signgamp)
  17. */
  18. #include <math.h>
  19. #include <math_private.h>
  20. #include <math-svid-compat.h>
  21. #include <libm-alias-ldouble.h>
  22. #if LIBM_SVID_COMPAT
  23. long double
  24. __lgammal_r(long double x, int *signgamp)
  25. {
  26. long double y = __ieee754_lgammal_r(x,signgamp);
  27. if(__builtin_expect(!isfinite(y), 0)
  28. && isfinite(x) && _LIB_VERSION != _IEEE_)
  29. return __kernel_standard(x, x,
  30. floorl(x)==x&&x<=0.0
  31. ? 215 /* lgamma pole */
  32. : 214); /* lgamma overflow */
  33. return y;
  34. }
  35. libm_alias_ldouble_r (__lgamma, lgamma, _r)
  36. #endif