]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/gamma.3
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man3 / gamma.3
CommitLineData
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
9gamma, gammaf, gammal \- (logarithm of the) gamma function
20e9513d
AC
10.SH LIBRARY
11Math 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
23Feature 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
42These functions are deprecated: instead, use either the
43.BR tgamma (3)
44or the
45.BR lgamma (3)
46functions, as appropriate.
847e0d88 47.PP
fea681da
MK
48For the definition of the Gamma function, see
49.BR tgamma (3).
73d8cece 50.SS *BSD version
ccf04431 51The libm in 4.4BSD and some versions of FreeBSD had a
63aa9df0 52.BR gamma ()
fea681da 53function that computes the Gamma function, as one would expect.
73d8cece 54.SS glibc version
fea681da 55Glibc has a
63aa9df0 56.BR gamma ()
fea681da 57function that is equivalent to
109b6459 58.BR lgamma (3)
fea681da 59and computes the natural logarithm of the Gamma function.
ccf04431
MK
60.SH RETURN VALUE
61See
62.BR lgamma (3).
63.SH ERRORS
64See
65.BR lgamma (3).
c53ce9cc
PH
66.SH ATTRIBUTES
67For 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
72allbox;
c466875e 73lbx lb lb
c53ce9cc
PH
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
c466875e
MK
82.hy
83.ad
84.sp 1
3113c7f3 85.SH STANDARDS
ccf04431 86Because of historical variations in behavior across systems,
c50730b6
MK
87this function is not specified in any recent standard.
88It was documented in SVID 2.
889829be
MK
89.SH NOTES
90.SS History
fea681da 914.2BSD had a
63aa9df0 92.BR gamma ()
fea681da
MK
93that computed
94.RI ln(|Gamma(| x |)|),
95leaving the sign of
96.RI Gamma(| x |)
97in the external integer
98.IR signgam .
99In 4.3BSD the name was changed to
109b6459 100.BR lgamma (3),
fea681da 101and 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
105and used for the Gamma function"
106.in
51f5698d 107.PP
fea681da 108This did indeed happen in 4.4BSD, where
63aa9df0 109.BR gamma ()
fea681da
MK
110computes the Gamma function (with no effect on
111.IR signgam ).
112However, this came too late, and we now have
109b6459 113.BR tgamma (3),
fea681da
MK
114the "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)