mount_setattr.2: Minor tweaks to Christian's patch
[man-pages.git] / man3 / gamma.3
blob0039641580d2242eb21f63f0fa34a3da683f6488
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
5 .\" %%%LICENSE_END
6 .\"
7 .\" Modified 2003-11-18, aeb: historical remarks
8 .\"
9 .TH GAMMA 3 2021-03-22 "GNU" "Linux Programmer's Manual"
10 .SH NAME
11 gamma, gammaf, gammal \- (logarithm of the) gamma function
12 .SH SYNOPSIS
13 .nf
14 .B #include <math.h>
15 .PP
16 .BI "double gamma(double " x ");"
17 .BI "float gammaf(float " x ");"
18 .BI "long double gammal(long double " x ");"
19 .fi
20 .PP
21 Link with \fI\-lm\fP.
22 .PP
23 .RS -4
24 Feature Test Macro Requirements for glibc (see
25 .BR feature_test_macros (7)):
26 .RE
27 .PP
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 .PP
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 .PP
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 .ad l
71 .nh
72 .TS
73 allbox;
74 lbx lb lb
75 l l l.
76 Interface       Attribute       Value
78 .BR gamma (),
79 .BR gammaf (),
80 .BR gammal ()
81 T}      Thread safety   MT-Unsafe race:signgam
82 .TE
83 .hy
84 .ad
85 .sp 1
86 .SH CONFORMING TO
87 Because of historical variations in behavior across systems,
88 this function is not specified in any recent standard.
89 It was documented in SVID 2.
90 .SH NOTES
91 .SS History
92 4.2BSD had a
93 .BR gamma ()
94 that computed
95 .RI ln(|Gamma(| x |)|),
96 leaving the sign of
97 .RI Gamma(| x |)
98 in the external integer
99 .IR signgam .
100 In 4.3BSD the name was changed to
101 .BR lgamma (3),
102 and the man page promises
104 .in +4n
105 "At some time in the future the name gamma will be rehabilitated
106 and used for the Gamma function"
109 This did indeed happen in 4.4BSD, where
110 .BR gamma ()
111 computes the Gamma function (with no effect on
112 .IR signgam ).
113 However, this came too late, and we now have
114 .BR tgamma (3),
115 the "true gamma" function.
116 .\" The FreeBSD man page says about gamma() that it is like lgamma()
117 .\" except that is does not set signgam.
118 .\" Also, that 4.4BSD has a gamma() that computes the true gamma function.
119 .SH SEE ALSO
120 .BR lgamma (3),
121 .BR signgam (3),
122 .BR tgamma (3)