GAMMA(3M) GAMMA(3M)
NAME
gamma - log gamma function
SYNOPSIS
#include <math.h>
double gamma(x)
double x;
DESCRIPTION
gamma returns ln|Γ(x)|.
The external integer signgam returns the sign of Γ(x) .
IDIOSYNCRASIES
Do not use the expression signgam*exp(gamma(x)) to compute g
:= Γ(x). Instead use a program like this (in C):
lg = gamma(x); g = signgam*exp(lg);
Only after gamma has returned can signgam be correct. Note
too that Γ(x) must overflow when x is large enough,
underflow when -x is large enough, and spawn a division by
zero when x is a nonpositive integer.
SEE ALSO
math(3M)
ORIGIN
4.3 BSD
Page 1 (last mod. 8/20/87)