LGAMMA(3) Library Functions Manual LGAMMA(3)

lgammalog gamma function

#include <math.h>

double lgamma(double x);
extern int signgam;

The lgamma() function computes
The sign of is returned in the external integer signgam . The argument x need not be a non-positive integer, ( is defined over the reals, except the non-positive integers).

An application wishing to check for error situations should set errno to 0 before calling lgamma(). If errno is non-zero on return, or the return value is NaN, an error has occurred.

This interface need not be reentrant.

Upon successful completion, lgamma() returns the logarithmic gamma of x .

If x is NaN, NaN is returned and errno may be set to [EDOM].

If x is a non-positive integer, either HUGE_VAL or NaN is returned and errno may be set to [EDOM].

If the correct value would cause overflow, lgamma() returns HUGE_VAL and may set errno to [ERANGE].

If the correct value would cause underflow, lgamma() returns 0 and may set errno to [ERANGE].

The lgamma() function may fail if:

The value of x is a non-positive integer or NaN.
The value to be returned would have caused overflow or underflow.

No other errors will occur.

None.

None.

None.

exp(3) , isnan(3) , <math.h> .

February 1997 posix.fail