Computes the log gamma.
#include <math.h> extern int signgam; double lgamma (x) double x; float lgammaf (x) float x; long double lgammal (x) long double x;
The sign of ( x) is returned in the external integer signgam.
The lgamma, lgammaf, and lgammal subroutines are not reentrant. A function that is not required to be reentrant is not required to be thread-safe.
An application wishing to check for error situations should set the errno global variable to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these subroutines. Upon return, if errno is nonzero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is nonzero, an error has occurred.
x | Specifies the value to be computed. |
Upon successful completion, the lgamma, lgammaf, and lgammal subroutines return the logarithmic gamma of x.
If x is a non-positive integer, a pole error shall occur and lgamma, lgammaf, and lgammal will return +HUGE_VAL, +HUGE_VALF, and +HUGE_VALL.
If the correct value would cause overflow, a range error shall occur and lgamma, lgammaf, and lgammal will return ±HUGE_VAL, ±HUGE_VALF, ±HUGE_VALL, respectively.
If x is NaN, a NaN is returned.
If x is 1 or 2, +0 is returned.
If x is ±Inf, +Inf is returned.
exp, expf, or expl Subroutine, feclearexcept Subroutine, fetestexcept Subroutine, and class, _class, finite, isnan, or unordered Subroutines.
math.h in AIX 5L Version 5.2 Files Reference.