Debian Codegraph @

upstream/debian-trixie/man3/gamma.3

raw
1 '\" t
2 .\" Copyright 2002 Walter Harms ([email protected])
3 .\"
4 .\" SPDX-License-Identifier: GPL-1.0-or-later
5 .\"
6 .\" Modified 2003-11-18, aeb: historical remarks
7 .\"
8 .TH gamma 3 2024-05-02 "Linux man-pages 6.9.1"
9 .SH NAME
10 gamma, gammaf, gammal \- (logarithm of the) gamma function
11 .SH LIBRARY
12 Math library
13 .RI ( libm ", " \-lm )
14 .SH SYNOPSIS
15 .nf
16 .B #include <math.h>
17 .P
18 .BI "[[deprecated]] double gamma(double " x ");"
19 .BI "[[deprecated]] float gammaf(float " x ");"
20 .BI "[[deprecated]] long double gammal(long double " x ");"
21 .fi
22 .P
23 .RS -4
24 Feature Test Macro Requirements for glibc (see
25 .BR feature_test_macros (7)):
26 .RE
27 .P
28 .BR gamma ():
29 .nf
30 _XOPEN_SOURCE
31 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
32 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
33 .fi
34 .P
35 .BR gammaf (),
36 .BR gammal ():
37 .nf
38 _XOPEN_SOURCE >= 600 || (_XOPEN_SOURCE && _ISOC99_SOURCE)
39 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
40 || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
41 .fi
42 .SH DESCRIPTION
43 These functions are deprecated: instead, use either the
44 .BR tgamma (3)
45 or the
46 .BR lgamma (3)
47 functions, as appropriate.
48 .P
49 For the definition of the Gamma function, see
50 .BR tgamma (3).
51 .SS *BSD version
52 The libm in 4.4BSD and some versions of FreeBSD had a
53 .BR gamma ()
54 function that computes the Gamma function, as one would expect.
55 .SS glibc version
56 glibc has a
57 .BR gamma ()
58 function that is equivalent to
59 .BR lgamma (3)
60 and computes the natural logarithm of the Gamma function.
61 .SH RETURN VALUE
62 See
63 .BR lgamma (3).
64 .SH ERRORS
65 See
66 .BR lgamma (3).
67 .SH ATTRIBUTES
68 For an explanation of the terms used in this section, see
69 .BR attributes (7).
70 .TS
71 allbox;
72 lbx lb lb
73 l l l.
74 Interface Attribute Value
75 T{
76 .na
77 .nh
78 .BR gamma (),
79 .BR gammaf (),
80 .BR gammal ()
81 T} Thread safety MT-Unsafe race:signgam
82 .TE
83 .SH STANDARDS
84 None.
85 .SH HISTORY
86 SVID 2.
87 .P
88 Because of historical variations in behavior across systems,
89 this function is not specified in any recent standard.
90 .P
91 4.2BSD had a
92 .BR gamma ()
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
100 .BR lgamma (3),
101 and the man page promises
102 .P
103 .in +4n
104 "At some time in the future the name gamma will be rehabilitated
105 and used for the Gamma function"
106 .in
107 .P
108 This did indeed happen in 4.4BSD, where
109 .BR gamma ()
110 computes the Gamma function (with no effect on
111 .IR signgam ).
112 However, this came too late, and we now have
113 .BR tgamma (3),
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.
118 .SH SEE ALSO
119 .BR lgamma (3),
120 .BR signgam (3),
121 .BR tgamma (3)