Search:

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

lgamma,lgammaf,lgammal,lgamma_r,lgammaf_r,tgamma,tgammaf,tgammal-- log gamma functions## SYNOPSIS

#include<math.h>externintsigngam;doublelgamma(doublex);floatlgammaf(floatx);longdoublelgammal(longdoublex);doublelgamma_r(doublex,int*signgamp);floatlgammaf_r(floatx,int*signgamp);doubletgamma(doublex);floattgammaf(floatx);longdoubletgammal(longdoublex); DESCRIPTION _lgamma(x) returns ln|| (x)|. _ The external integersigngamreturns the sign of | (x). Thelgammaf() function is a single precision version oflgamma(). Thelgammal() func- tion is an extended precision version oflgamma(). Thelgamma_r() andlgammaf_r() functions are thread-safe versions oflgamma() andlgammaf() that return the sign via thesigngamppointer instead of modifyingsigngam. _ Thetgamma(x),tgammaf(x) andtgammal(x) functions return | (x), with no effect onsigngam. IDIOSYNCRASIES _ Do 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() 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.## RETURN VALUES

lgamma() returns appropriate values unless an argument is out of range. Overflow will occur for sufficiently large positive values, and non-posi- tive integers. For large non-integer negative values,tgamma() will underflow. On the VAX, the reserved operator is returned, anderrnois set to ERANGE.## SEE ALSO

infnan(3)## STANDARDS

Thelgamma(),lgammaf(),lgammal(),tgamma(),tgammaf(), andtgammal() functions are expected to conform to ISO/IEC 9899:1999 (``ISO C99''). Thelgamma_r() andlgammaf_r() functions are BSD extensions.gamma() andgammaf() are deprecated aliases forlgamma() andlgammaf(), respectively.## HISTORY

Agamma() function first appeared in Version 5 AT&T UNIX. Thelgamma() function first appeared in 4.3BSD. Thetgamma() function first appeared in OpenBSD 4.4, and is based on t_egamma() function that appeared in 4.4BSD as a function to compute | (x). DragonFly 4.9 January 15, 2015 DragonFly 4.9

Search: