1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\" based on glibc infopages
5 .TH LGAMMA 3 2002-08-10 "" "Linux Programmer's Manual"
7 lgamma, lgammaf, lgammal, lgamma_r, lgammaf_r, lgammal_r \- log gamma function
12 .BI "double lgamma(double " x );
14 .BI "float lgammaf(float " x );
16 .BI "long double lgammal(long double " x );
18 .BI "double lgamma_r(double " x ", int *" signp );
20 .BI "float lgammaf_r(float " x ", int *" signp );
22 .BI "long double lgammal_r(long double " x ", int *" signp );
25 Compile with \fI\-std=c99\fP; link with \fI\-lm\fP.
27 For the definition of the Gamma function, see
32 function returns the natural logarithm of
33 the absolute value of the Gamma function.
34 The sign of the Gamma function is returned in the
35 external integer \fIsigngam\fP declared in
37 It is 1 when the Gamma function is positive or zero, \-1
40 Since using a constant location
42 is not thread-safe, the functions
45 been introduced; they return this sign via the parameter
48 For non-positive integer values of \fIx\fP,
54 and raises the zero divide exception.
64 In order to check for errors, set
67 .I feclearexcept(FE_ALL_EXCEPT)
68 before calling these functions.
72 .I fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW)
73 is non-zero, an error has occurred.
75 A range error occurs if x is too large.
76 A pole error occurs if x is a negative integer or zero.