The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

lgamma - log gamma function

 SYNOPSIS



#include <math.h>

double lgamma(double x);
extern int signgam;

 DESCRIPTION

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.

 RETURN VALUE

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].

 ERRORS

The lgamma() function may fail if:
[EDOM]
The value of x is a non-positive integer or NaN.
[ERANGE]
The value to be returned would have caused overflow or underflow.

No other errors will occur.

 EXAMPLES

None.

 APPLICATION USAGE

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

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

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]