1GAMMA(3) Linux Programmer's Manual GAMMA(3)
2
3
4
6 gamma, gammaf, gammal - (logarithm of the) gamma function
7
9 #include <math.h>
10
11 double gamma(double x);
12 float gammaf(float x);
13 long double gammal(long double x);
14
15 Link with -lm.
16
17 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19 gamma():
20 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
21 gammaf(), gammal():
22 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600
23
25 These functions are deprecated: instead, use either the tgamma(3) or
26 the lgamma(3) functions, as appropriate.
27
28 For the definition of the Gamma function, see tgamma(3).
29
30 *BSD version
31 The libm in 4.4BSD and some versions of FreeBSD had a gamma() function
32 that computes the Gamma function, as one would expect.
33
34 glibc version
35 Glibc has a gamma() function that is equivalent to lgamma(3) and com‐
36 putes the natural logarithm of the Gamma function.
37
39 See lgamma(3).
40
42 See lgamma(3).
43
45 Because of historical variations in behavior across systems, this func‐
46 tion is not specified in any standard.
47
49 History
50 4.2BSD had a gamma() that computed ln(|Gamma(|x|)|), leaving the sign
51 of Gamma(|x|) in the external integer signgam. In 4.3BSD the name was
52 changed to lgamma(3), and the man page promises
53
54 "At some time in the future the name gamma will be rehabilitated
55 and used for the Gamma function"
56
57 This did indeed happen in 4.4BSD, where gamma() computes the Gamma
58 function (with no effect on signgam). However, this came too late, and
59 we now have tgamma(3), the "true gamma" function.
60
62 lgamma(3), signgam(3), tgamma(3)
63
65 This page is part of release 3.53 of the Linux man-pages project. A
66 description of the project, and information about reporting bugs, can
67 be found at http://www.kernel.org/doc/man-pages/.
68
69
70
71GNU 2008-08-05 GAMMA(3)