Commit | Line | Data |
---|---|---|
e6817382 BJ |
1 | .TH GAMMA 3M |
2 | .SH NAME | |
3 | gamma \- 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 | |
12 | returns | |
13 | ln |\(*G(|\fIx\fR|)|. | |
14 | The sign of | |
15 | \(*G(|\fIx\fR|) | |
16 | is returned in the external integer | |
17 | .IR signgam . | |
18 | The following C program might be | |
19 | used 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 | |
34 | A huge value is returned for negative integer arguments. | |
35 | .SH BUGS | |
36 | There should be a positive indication of error. |