LGAMMA(3) DragonFly Library Functions Manual LGAMMA(3)## NAME

lgamma,lgamma_r,lgammaf,lgammaf_r,gamma,gamma_r,gammaf,gammaf_r,tgamma,tgammaf-- log gamma functions, gamma function## LIBRARY

Math Library (libm, -lm)## SYNOPSIS

#include<math.h>externintsigngam;doublelgamma(doublex);doublelgamma_r(doublex,int*signgamp);floatlgammaf(floatx);floatlgammaf_r(floatx,int*signgamp);doublegamma(doublex);doublegamma_r(doublex,int*signgamp);floatgammaf(floatx);floatgammaf_r(floatx,int*signgamp);doubletgamma(doublex);floattgammaf(floatx); DESCRIPTION _lgamma(x) andlgammaf_x) return ln|| (x)|. The external integersigngamreturns the sign of | (x).lgamma_r(x,signgamp) andlgammaf_r(x,signgamp) provide the same func- tionality aslgamma(x) andlgammaf(x) but the caller must provide an integer to store the sign of | (x). _ Thetgamma(x) andtgammaf(x) functions return | (x), with no effect onsigngam.gamma(),gammaf(),gamma_r(), andgammaf_r() are deprecated aliases forlgamma(),lgammaf(),lgamma_r(), andlgammaf_r(), respectively.## IDIOSYNCRASIES

D_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 afterlgamma() orlgammaf() has returned can signgam be correct. For arguments in its range,tgamma() is preferred, as for positive argu- ments it is accurate to within one unit in the last place. Exponentia- tion oflgamma() will lose up to 10 significant bits.## RETURN VALUES

gamma(),gamma_r(),gammaf(),gammaf_r(),lgamma(),lgamma_r(),lgammaf(), andlgammaf_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 val- ues,tgamma() will underflow.## SEE ALSO

math(3)## STANDARDS

Thelgamma(),lgammaf(),tgamma(), andtgammaf() functions are expected to conform to ISO/IEC 9899:1999 (``ISO C99'').## HISTORY

Thelgamma() function appeared in 4.3BSD_Thegamma() function appeared in 4.4BSD as a function which computed | (x). This version was used in FreeBSD 1.1. The namegamma() was originally dedicated to thelgamma() function, and that usage was restored by switching to Sun's fdlibm in FreeBSD 1.1.5. Thetgamma() function appeared in DragonFly 2.13. DragonFly 3.7 December 21, 2011 DragonFly 3.7