w_lgammal_main.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* w_lgammal.c -- long double version of w_lgamma.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. /* long double lgammal(long double x)
  16. * Return the logarithm of the Gamma function of x.
  17. *
  18. * Method: call __ieee754_lgammal_r
  19. */
  20. #include <math.h>
  21. #include <math_private.h>
  22. #include <math-svid-compat.h>
  23. #include <libm-alias-ldouble.h>
  24. #include <lgamma-compat.h>
  25. #if BUILD_LGAMMA
  26. long double
  27. LGFUNC (__lgammal) (long double x)
  28. {
  29. long double y = CALL_LGAMMA (long double, __ieee754_lgammal_r, x);
  30. if(__builtin_expect(!isfinite(y), 0)
  31. && isfinite(x) && _LIB_VERSION != _IEEE_)
  32. return __kernel_standard_l(x, x,
  33. floorl(x)==x&&x<=0.0L
  34. ? 215 /* lgamma pole */
  35. : 214); /* lgamma overflow */
  36. return y;
  37. }
  38. # if USE_AS_COMPAT
  39. compat_symbol (libm, __lgammal_compat, lgammal, LGAMMA_OLD_VER);
  40. # else
  41. versioned_symbol (libm, __lgammal, lgammal, LGAMMA_NEW_VER);
  42. libm_alias_ldouble_other (__lgamma, lgamma)
  43. # endif
  44. # if GAMMA_ALIAS
  45. strong_alias (LGFUNC (__lgammal), __gammal)
  46. weak_alias (__gammal, gammal)
  47. # endif
  48. #endif