BSD 4 development
[unix-history] / usr / man / man3 / gamma.3m
.TH GAMMA 3M
.SH NAME
gamma \- log gamma function
.SH SYNOPSIS
.nf
.B #include <math.h>
.PP
.B double gamma(x)
.B double x;
.fi
.SH DESCRIPTION
.I Gamma
returns
ln \||\|\(*G(\||\|\fIx\fR\||\|)\||\|.
The sign of
\(*G(\||\|\fIx\fR\||\|)
is returned in the external integer
.IR signgam .
The following C program might be
used to calculate
\(*G:
.PP
.nf
y = gamma(x);
if (y > 88.0)
error();
y = exp(y);
if(signgam)
y = \-y;
.fi
.SH DIAGNOSTICS
A huge value is returned for negative integer arguments.
.SH BUGS
There should be a positive indication of error.