BSD 3 development
[unix-history] / usr / man / man3 / gamma.3m
CommitLineData
e6817382
BJ
1.TH GAMMA 3M
2.SH NAME
3gamma \- log gamma function
4.SH SYNOPSIS
5.B #include <math.h>
6.PP
7.B double gamma(x)
8.br
9.B double x;
10.SH DESCRIPTION
11.I Gamma
12returns
13ln |\(*G(|\fIx\fR|)|.
14The sign of
15\(*G(|\fIx\fR|)
16is returned in the external integer
17.IR signgam .
18The following C program might be
19used to calculate
20\(*G:
21.PP
22 y = gamma(x);
23.br
24 if (y > 88.)
25.br
26 error( );
27.br
28 y = exp(y);
29.br
30 if(signgam)
31.br
32 y = \-y;
33.SH DIAGNOSTICS
34A huge value is returned for negative integer arguments.
35.SH BUGS
36There should be a positive indication of error.