Main index | Section 3 | Options |
#include <math.h>
double
lgamma(double x);
double
lgamma_r(double x, int *signgamp);
float
lgammaf(float x);
float
lgammaf_r(float x, int *signgamp);
long double
lgammal(long double x);
long double
lgammal_r(long double x, int *signgamp);
double
gamma(double x);
double
gamma_r(double x, int *signgamp);
float
gammaf(float x);
float
gammaf_r(float x, int *signgamp);
long double
tgamma(double x);
float
tgammaf(float x);
long double
tgammal(long double x);
Γ(x) = ∫0∞ tx-1 e-t dt for x > 0 and Γ(x) = π/(Γ(1-x)sin(πx)) for x < 1.return ln|Γ(x)|. The external integer signgam returns the sign of Γ(x).
lgamma_r(x, signgamp), lgammaf_r(x, signgamp), and lgammal_r(x, signgamp) provide the same functionality as lgamma(x), lgammaf(x), and lgammal(x), but the caller must provide an integer to store the sign of Γ(x).
The tgamma(x), tgammaf(x), and tgammal(x) functions return Γ(x), with no effect on signgam.
gamma(), gammaf(), gamma_r(), and gammaf_r() are deprecated aliases for lgamma(), lgammaf(), lgamma_r(), and lgammaf_r(), respectively.
lg = lgamma(x); g = signgam*exp(lg);
Only after lgamma() or lgammaf() has returned can signgam be correct.
For arguments in its range, tgamma() is preferred, as for positive arguments it is accurate to within one unit in the last place. Exponentiation of lgamma() will lose up to 10 significant bits.
LGAMMA (3) | December 8, 2017 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | If you have an emergency I'm great at running around and flailing my arms | ” |
— Artur Bagyants |