]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/gamma.3
encrypt.3: srcfix: rewrap source lines
[thirdparty/man-pages.git] / man3 / gamma.3
CommitLineData
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
11gamma, 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 21Link with \fI\-lm\fP.
68e4db0a 22.PP
cc4615cc
MK
23.in -4n
24Feature 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
44These functions are deprecated: instead, use either the
45.BR tgamma (3)
46or the
47.BR lgamma (3)
48functions, as appropriate.
847e0d88 49.PP
fea681da
MK
50For the definition of the Gamma function, see
51.BR tgamma (3).
73d8cece 52.SS *BSD version
ccf04431 53The libm in 4.4BSD and some versions of FreeBSD had a
63aa9df0 54.BR gamma ()
fea681da 55function that computes the Gamma function, as one would expect.
73d8cece 56.SS glibc version
fea681da 57Glibc has a
63aa9df0 58.BR gamma ()
fea681da 59function that is equivalent to
109b6459 60.BR lgamma (3)
fea681da 61and computes the natural logarithm of the Gamma function.
ccf04431
MK
62.SH RETURN VALUE
63See
64.BR lgamma (3).
65.SH ERRORS
66See
67.BR lgamma (3).
c53ce9cc
PH
68.SH ATTRIBUTES
69For an explanation of the terms used in this section, see
70.BR attributes (7).
71.TS
72allbox;
73lbw27 lb lb
74l l l.
75Interface Attribute Value
76T{
77.BR gamma (),
78.BR gammaf (),
79.BR gammal ()
0bd42ffb 80T} Thread safety MT-Unsafe race:signgam
c53ce9cc 81.TE
47297adb 82.SH CONFORMING TO
ccf04431 83Because of historical variations in behavior across systems,
c50730b6
MK
84this function is not specified in any recent standard.
85It was documented in SVID 2.
889829be
MK
86.SH NOTES
87.SS History
fea681da 884.2BSD had a
63aa9df0 89.BR gamma ()
fea681da
MK
90that computed
91.RI ln(|Gamma(| x |)|),
92leaving the sign of
93.RI Gamma(| x |)
94in the external integer
95.IR signgam .
96In 4.3BSD the name was changed to
109b6459 97.BR lgamma (3),
fea681da 98and 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
102and used for the Gamma function"
103.in
51f5698d 104.PP
fea681da 105This did indeed happen in 4.4BSD, where
63aa9df0 106.BR gamma ()
fea681da
MK
107computes the Gamma function (with no effect on
108.IR signgam ).
109However, this came too late, and we now have
109b6459 110.BR tgamma (3),
fea681da
MK
111the "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)