]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) |
2297bf0e | 2 | .\" |
95fb8859 | 3 | .\" SPDX-License-Identifier: GPL-1.0-or-later |
fea681da MK |
4 | .\" |
5 | .\" Modified 2003-11-18, aeb: historical remarks | |
6 | .\" | |
4c1c5274 | 7 | .TH gamma 3 (date) "Linux man-pages (unreleased)" |
fea681da MK |
8 | .SH NAME |
9 | gamma, gammaf, gammal \- (logarithm of the) gamma function | |
20e9513d AC |
10 | .SH LIBRARY |
11 | Math library | |
8fc3b2cf | 12 | .RI ( libm ", " \-lm ) |
fea681da | 13 | .SH SYNOPSIS |
c7db92b9 | 14 | .nf |
fea681da | 15 | .B #include <math.h> |
68e4db0a | 16 | .PP |
6b7d08b2 AC |
17 | .BI "[[deprecated]] double gamma(double " x ");" |
18 | .BI "[[deprecated]] float gammaf(float " x ");" | |
19 | .BI "[[deprecated]] long double gammal(long double " x ");" | |
c7db92b9 | 20 | .fi |
68e4db0a | 21 | .PP |
d39ad78f | 22 | .RS -4 |
cc4615cc MK |
23 | Feature Test Macro Requirements for glibc (see |
24 | .BR feature_test_macros (7)): | |
d39ad78f | 25 | .RE |
68e4db0a | 26 | .PP |
ccf04431 | 27 | .BR gamma (): |
9d2adbae MK |
28 | .nf |
29 | _XOPEN_SOURCE | |
30 | || /* Since glibc 2.19: */ _DEFAULT_SOURCE | |
31 | || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
32 | .fi | |
0129eef2 | 33 | .PP |
cc4615cc MK |
34 | .BR gammaf (), |
35 | .BR gammal (): | |
9d2adbae MK |
36 | .nf |
37 | _XOPEN_SOURCE >= 600 || (_XOPEN_SOURCE && _ISOC99_SOURCE) | |
38 | || /* Since glibc 2.19: */ _DEFAULT_SOURCE | |
39 | || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
40 | .fi | |
fea681da | 41 | .SH DESCRIPTION |
ccf04431 MK |
42 | These functions are deprecated: instead, use either the |
43 | .BR tgamma (3) | |
44 | or the | |
45 | .BR lgamma (3) | |
46 | functions, as appropriate. | |
847e0d88 | 47 | .PP |
fea681da MK |
48 | For the definition of the Gamma function, see |
49 | .BR tgamma (3). | |
73d8cece | 50 | .SS *BSD version |
ccf04431 | 51 | The libm in 4.4BSD and some versions of FreeBSD had a |
63aa9df0 | 52 | .BR gamma () |
fea681da | 53 | function that computes the Gamma function, as one would expect. |
73d8cece | 54 | .SS glibc version |
fea681da | 55 | Glibc has a |
63aa9df0 | 56 | .BR gamma () |
fea681da | 57 | function that is equivalent to |
109b6459 | 58 | .BR lgamma (3) |
fea681da | 59 | and computes the natural logarithm of the Gamma function. |
ccf04431 MK |
60 | .SH RETURN VALUE |
61 | See | |
62 | .BR lgamma (3). | |
63 | .SH ERRORS | |
64 | See | |
65 | .BR lgamma (3). | |
c53ce9cc PH |
66 | .SH ATTRIBUTES |
67 | For an explanation of the terms used in this section, see | |
68 | .BR attributes (7). | |
c466875e MK |
69 | .ad l |
70 | .nh | |
c53ce9cc PH |
71 | .TS |
72 | allbox; | |
c466875e | 73 | lbx lb lb |
c53ce9cc PH |
74 | l l l. |
75 | Interface Attribute Value | |
76 | T{ | |
77 | .BR gamma (), | |
78 | .BR gammaf (), | |
79 | .BR gammal () | |
0bd42ffb | 80 | T} Thread safety MT-Unsafe race:signgam |
c53ce9cc | 81 | .TE |
c466875e MK |
82 | .hy |
83 | .ad | |
84 | .sp 1 | |
3113c7f3 | 85 | .SH STANDARDS |
ccf04431 | 86 | Because of historical variations in behavior across systems, |
c50730b6 MK |
87 | this function is not specified in any recent standard. |
88 | It was documented in SVID 2. | |
889829be MK |
89 | .SH NOTES |
90 | .SS History | |
fea681da | 91 | 4.2BSD had a |
63aa9df0 | 92 | .BR gamma () |
fea681da MK |
93 | that computed |
94 | .RI ln(|Gamma(| x |)|), | |
95 | leaving the sign of | |
96 | .RI Gamma(| x |) | |
97 | in the external integer | |
98 | .IR signgam . | |
99 | In 4.3BSD the name was changed to | |
109b6459 | 100 | .BR lgamma (3), |
fea681da | 101 | and the man page promises |
51f5698d | 102 | .PP |
088a639b | 103 | .in +4n |
fea681da MK |
104 | "At some time in the future the name gamma will be rehabilitated |
105 | and used for the Gamma function" | |
106 | .in | |
51f5698d | 107 | .PP |
fea681da | 108 | This did indeed happen in 4.4BSD, where |
63aa9df0 | 109 | .BR gamma () |
fea681da MK |
110 | computes the Gamma function (with no effect on |
111 | .IR signgam ). | |
112 | However, this came too late, and we now have | |
109b6459 | 113 | .BR tgamma (3), |
fea681da MK |
114 | the "true gamma" function. |
115 | .\" The FreeBSD man page says about gamma() that it is like lgamma() | |
116 | .\" except that is does not set signgam. | |
117 | .\" Also, that 4.4BSD has a gamma() that computes the true gamma function. | |
47297adb | 118 | .SH SEE ALSO |
fea681da MK |
119 | .BR lgamma (3), |
120 | .BR signgam (3), | |
121 | .BR tgamma (3) |