Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

lgamma, lgammaf, lgammal, gamma, signgam - compute logarithm of gamma function

&pagelevel(4)&pagelevel

Definition

#include <math.h>

double gamma(double x);
double lgamma(double x);
float lgammaf(float x); (C11)
long double lgammal(long double x); (C11)

extern int signgam;

These functions compute the natural logarithm of the absolute value of the mathematical gamma function for a given floating-point number x:

The sign of this value is stored as +1 or -1 in the internal C variable signgam. The signgam variable must not be defined by the user.

Return val.

log(|tgamma(x)|)

if successful.


HUGE_VAL
HUGE_VALF
HUGE_VALL

depending on the function type, if the correct value results in an overflow.

In addition, errno is set to ERANGE (result too large). 


HUGE_VAL
HUGE_VALF
HUGE_VALL

depending on the function type, if x is a non-positive integer.
In addition, errno is set to EDOM (illegal argument). 

See also

fabs, tgamma