Copyright © 1997 The Open Group

lgamma - log gamma function

`#include <math.h> double lgamma(double`

x); extern int signgam;

Thelgamma()function computes

The sign of is returned in the external integersigngam. The argumentxneed 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

errnoto 0 before callinglgamma(). Iferrnois 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 ofx.If

xis NaN, NaN is returned anderrnomay be set to [EDOM].If

xis a non-positive integer, either HUGE_VAL or NaN is returned anderrnomay be set to [EDOM].If the correct value would cause overflow,

lgamma()returns HUGE_VAL and may seterrnoto [ERANGE].If the correct value would cause underflow,

lgamma()returns 0 and may seterrnoto [ERANGE].

Thelgamma()function may fail if:

- [EDOM]
- The value of
xis a non-positive integer or NaN.- [ERANGE]
- The value to be returned would have caused overflow or underflow.
No other errors will occur.

None.

None.

None.

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

Copyright © 1997 The Open Group

[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]