Seth Woolley's Man Viewer

lgamma(3) - lgamma, lgamma_r, lgammaf, lgammaf_r, lgammal, lgammal_r, lgamma, lgamma_r, lgammaf, lgammaf_r, lgammal, lgammal_r - log gamma function - man 3 lgamma

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

LGAMMA(3)                  Linux Programmer's Manual                 LGAMMA(3)

       lgamma,  lgammaf,  lgammal,  lgamma_r, lgammaf_r, lgammal_r - log gamma

       #include <math.h>

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

       double lgamma_r(double x, int *signp);
       float lgammaf_r(float x, int *signp);
       long double lgammal_r(long double x, int *signp);

       Link with -lm.

       For the definition of the Gamma function, see tgamma(3).

       The lgamma() function returns the natural  logarithm  of  the  absolute
       value  of  the  Gamma  function.   The  sign  of  the Gamma function is
       returned in(1,8) the external integer signgam declared in(1,8) <math.h>.  It is 1
       when the Gamma function is positive or zero, -1 when it is negative.

       Since  using  a constant location signgam is not thread-safe, the func-
       tions lgamma_r() etc. have been introduced; they return this  sign  via
       the parameter signp.

       For  nonpositive  integer  values of x, lgamma() returns HUGE_VAL, sets
       errno to ERANGE and raises  the  zero  divide  exception.   (Similarly,
       lgammaf() returns HUGE_VALF and lgammal() returns HUGE_VALL.)

       In  order  to  check  for errors, set(7,n,1 builtins) errno to zero and call feclearex-
       cept(FE_ALL_EXCEPT) before calling these functions. On return, if(3,n) errno
       is  non-zero  or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW |
       FE_UNDERFLOW) is non-zero, an error(8,n) has occurred.

       A range error(8,n) occurs if(3,n) x is too large.  A pole error(8,n) occurs if(3,n) x is  a
       negative integer or zero.

       C99, SVID 3, BSD 4.3


                                  2002-08-10                         LGAMMA(3)

References for this manual (incoming links)