1LGAMMA(3)                  Linux Programmer's Manual                 LGAMMA(3)
2
3
4

NAME

6       lgamma,  lgammaf,  lgammal,  lgamma_r, lgammaf_r, lgammal_r - log gamma
7       function
8

SYNOPSIS

10       #include <math.h>
11
12       double lgamma(double x);
13       float lgammaf(float x);
14       long double lgammal(long double x);
15
16       double lgamma_r(double x, int *signp);
17       float lgammaf_r(float x, int *signp);
18       long double lgammal_r(long double x, int *signp);
19
20       Compile with -std=c99; link with -lm.
21

DESCRIPTION

23       For the definition of the Gamma function, see tgamma(3).
24
25       The lgamma() function returns the natural  logarithm  of  the  absolute
26       value  of  the  Gamma  function.   The  sign  of  the Gamma function is
27       returned in the external integer signgam declared in <math.h>.  It is 1
28       when the Gamma function is positive or zero, -1 when it is negative.
29
30       Since  using  a constant location signgam is not thread-safe, the func‐
31       tions lgamma_r() etc. have been introduced; they return this  sign  via
32       the parameter signp.
33
34       For  non-positive  integer values of x, lgamma() returns HUGE_VAL, sets
35       errno to ERANGE and raises  the  zero  divide  exception.   (Similarly,
36       lgammaf() returns HUGE_VALF and lgammal() returns HUGE_VALL.)
37

ERRORS

39       In  order  to  check  for errors, set errno to zero and call feclearex‐
40       cept(FE_ALL_EXCEPT) before calling these functions. On return, if errno
41       is  non-zero  or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW |
42       FE_UNDERFLOW) is non-zero, an error has occurred.
43
44       A range error occurs if x is too large.  A pole error occurs if x is  a
45       negative integer or zero.
46

CONFORMING TO

48       C99, SVr4, 4.3BSD
49

SEE ALSO

51       tgamma(3)
52
53
54
55                                  2002-08-10                         LGAMMA(3)
Impressum