w_lgamma.c 947 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* @(#)w_lgamma.c 5.1 93/09/24 */
  2. /*
  3. * ====================================================
  4. * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  5. *
  6. * Developed at SunPro, a Sun Microsystems, Inc. business.
  7. * Permission to use, copy, modify, and distribute this
  8. * software is freely granted, provided that this notice
  9. * is preserved.
  10. * ====================================================
  11. */
  12. /* double lgamma(double x)
  13. * Return the logarithm of the Gamma function of x.
  14. *
  15. * Method: call __ieee754_lgamma_r
  16. */
  17. #include <math.h>
  18. #include "math_private.h"
  19. double
  20. lgamma(double x)
  21. {
  22. return lgamma_r(x, &signgam);
  23. }
  24. libm_hidden_def(lgamma)
  25. /* NB: gamma function is an old name for lgamma.
  26. * It is deprecated.
  27. * Some C math libraries redefine it as a "true gamma", i.e.,
  28. * not a ln(|Gamma(x)|) but just Gamma(x), but standards
  29. * introduced tgamma name for that.
  30. */
  31. strong_alias(lgamma, gamma)
  32. libm_hidden_def(gamma)