]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) |
2297bf0e | 2 | .\" |
38f20bb9 | 3 | .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE) |
fea681da | 4 | .\" Distributed under GPL |
38f20bb9 | 5 | .\" %%%LICENSE_END |
fea681da MK |
6 | .\" |
7 | .\" Modified 2003-11-18, aeb: historical remarks | |
8 | .\" | |
4b8c67d9 | 9 | .TH GAMMA 3 2017-09-15 "GNU" "Linux Programmer's Manual" |
fea681da MK |
10 | .SH NAME |
11 | gamma, gammaf, gammal \- (logarithm of the) gamma function | |
12 | .SH SYNOPSIS | |
13 | .B #include <math.h> | |
68e4db0a | 14 | .PP |
fea681da | 15 | .BI "double gamma(double " x ");" |
d39541ec | 16 | .br |
fea681da | 17 | .BI "float gammaf(float " x ");" |
d39541ec | 18 | .br |
fea681da | 19 | .BI "long double gammal(long double " x ");" |
68e4db0a | 20 | .PP |
20c58d70 | 21 | Link with \fI\-lm\fP. |
68e4db0a | 22 | .PP |
cc4615cc MK |
23 | .in -4n |
24 | Feature Test Macro Requirements for glibc (see | |
25 | .BR feature_test_macros (7)): | |
26 | .in | |
68e4db0a | 27 | .PP |
cc4615cc | 28 | .ad l |
ccf04431 | 29 | .BR gamma (): |
257debad | 30 | .RS 4 |
636ed4d5 MK |
31 | _XOPEN_SOURCE |
32 | || /* Since glibc 2.19: */ _DEFAULT_SOURCE | |
33 | || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
257debad | 34 | .RE |
cc4615cc MK |
35 | .BR gammaf (), |
36 | .BR gammal (): | |
257debad | 37 | .RS 4 |
636ed4d5 MK |
38 | _XOPEN_SOURCE >= 600 || (_XOPEN_SOURCE && _ISOC99_SOURCE) |
39 | || /* Since glibc 2.19: */ _DEFAULT_SOURCE | |
40 | || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
257debad | 41 | .RE |
cc4615cc | 42 | .ad b |
fea681da | 43 | .SH DESCRIPTION |
ccf04431 MK |
44 | These functions are deprecated: instead, use either the |
45 | .BR tgamma (3) | |
46 | or the | |
47 | .BR lgamma (3) | |
48 | functions, as appropriate. | |
847e0d88 | 49 | .PP |
fea681da MK |
50 | For the definition of the Gamma function, see |
51 | .BR tgamma (3). | |
73d8cece | 52 | .SS *BSD version |
ccf04431 | 53 | The libm in 4.4BSD and some versions of FreeBSD had a |
63aa9df0 | 54 | .BR gamma () |
fea681da | 55 | function that computes the Gamma function, as one would expect. |
73d8cece | 56 | .SS glibc version |
fea681da | 57 | Glibc has a |
63aa9df0 | 58 | .BR gamma () |
fea681da | 59 | function that is equivalent to |
109b6459 | 60 | .BR lgamma (3) |
fea681da | 61 | and computes the natural logarithm of the Gamma function. |
ccf04431 MK |
62 | .SH RETURN VALUE |
63 | See | |
64 | .BR lgamma (3). | |
65 | .SH ERRORS | |
66 | See | |
67 | .BR lgamma (3). | |
c53ce9cc PH |
68 | .SH ATTRIBUTES |
69 | For an explanation of the terms used in this section, see | |
70 | .BR attributes (7). | |
71 | .TS | |
72 | allbox; | |
73 | lbw27 lb lb | |
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 |
47297adb | 82 | .SH CONFORMING TO |
ccf04431 | 83 | Because of historical variations in behavior across systems, |
c50730b6 MK |
84 | this function is not specified in any recent standard. |
85 | It was documented in SVID 2. | |
889829be MK |
86 | .SH NOTES |
87 | .SS History | |
fea681da | 88 | 4.2BSD had a |
63aa9df0 | 89 | .BR gamma () |
fea681da MK |
90 | that computed |
91 | .RI ln(|Gamma(| x |)|), | |
92 | leaving the sign of | |
93 | .RI Gamma(| x |) | |
94 | in the external integer | |
95 | .IR signgam . | |
96 | In 4.3BSD the name was changed to | |
109b6459 | 97 | .BR lgamma (3), |
fea681da | 98 | and the man page promises |
51f5698d | 99 | .PP |
088a639b | 100 | .in +4n |
fea681da MK |
101 | "At some time in the future the name gamma will be rehabilitated |
102 | and used for the Gamma function" | |
103 | .in | |
51f5698d | 104 | .PP |
fea681da | 105 | This did indeed happen in 4.4BSD, where |
63aa9df0 | 106 | .BR gamma () |
fea681da MK |
107 | computes the Gamma function (with no effect on |
108 | .IR signgam ). | |
109 | However, this came too late, and we now have | |
109b6459 | 110 | .BR tgamma (3), |
fea681da MK |
111 | the "true gamma" function. |
112 | .\" The FreeBSD man page says about gamma() that it is like lgamma() | |
113 | .\" except that is does not set signgam. | |
114 | .\" Also, that 4.4BSD has a gamma() that computes the true gamma function. | |
47297adb | 115 | .SH SEE ALSO |
fea681da MK |
116 | .BR lgamma (3), |
117 | .BR signgam (3), | |
118 | .BR tgamma (3) |