|
NAMElgamma , lgamma_r ,
lgammaf , lgammaf_r ,
lgammal , lgammal_r ,
gamma , gamma_r ,
gammaf , gammaf_r ,
tgamma , tgammaf ,
tgammal , —
log gamma functions, gamma function
LIBRARYMath Library (libm, -lm)SYNOPSIS#include <math.h>
extern int signgam;
double
float
float
long double
long double
double
double
float
float
long double
float
long double
DESCRIPTIONlgamma (x),
lgammaf (x), and
lgammal (x) return
ln|Γ(x)|. The external integer signgam returns
the sign of Γ(x).
The
IDIOSYNCRASIESDo not use the expression “signgam∗exp(lgamma(x)) ” to
compute g := Γ(x). Instead use a program like this (in C):
lg = lgamma(x); g = signgam∗exp(lg); Only after For arguments in its range, RETURN VALUESgamma (), gammaf (),
gammal (), gamma_r (),
gammaf_r (), gammal_r (),
lgamma (), lgammaf (),
lgammal (), lgamma_r (),
lgammaf_r (), and lgammal_r ()
return appropriate values unless an argument is out of range. Overflow will
occur for sufficiently large positive values, and non-positive integers. For
large non-integer negative values, tgamma () will
underflow.
BUGSTo conform with newer C/C++ standards, a stub implementation fortgammal was committed to the math library, where
tgammal is mapped to tgamma .
Thus, the numerical accuracy is at most that of the 53-bit double precision
implementation.
SEE ALSOmath(3)STANDARDSThelgamma (), lgammaf (),
lgammal (), tgamma (),
tgammaf (), and tgammal ()
functions are expected to conform to ISO/IEC 9899:1999
(“ISO C99”).
HISTORYThelgamma () function appeared in
4.3BSD. The gamma () function
appeared in 4.4BSD as a function which computed
Γ(x). This version was used in FreeBSD 1.1. The
name gamma () was originally dedicated to the
lgamma () function, and that usage was restored by
switching to Sun's fdlibm in FreeBSD 1.1.5. The
tgamma () function appeared in FreeBSD
5.0.
Visit the GSP FreeBSD Man Page Interface. |