]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/gamma.3
prctl.2: Clarify the unsupported hardware case of EINVAL
[thirdparty/man-pages.git] / man3 / gamma.3
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 2017-09-15 "GNU" "Linux Programmer's Manual"
10 .SH NAME
11 gamma, gammaf, gammal \- (logarithm of the) gamma function
12 .SH SYNOPSIS
13 .B #include <math.h>
14 .PP
15 .BI "double gamma(double " x ");"
16 .br
17 .BI "float gammaf(float " x ");"
18 .br
19 .BI "long double gammal(long double " x ");"
20 .PP
21 Link with \fI\-lm\fP.
22 .PP
23 .in -4n
24 Feature Test Macro Requirements for glibc (see
25 .BR feature_test_macros (7)):
26 .in
27 .PP
28 .ad l
29 .BR gamma ():
30 .RS 4
31 _XOPEN_SOURCE
32 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
33 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
34 .RE
35 .BR gammaf (),
36 .BR gammal ():
37 .RS 4
38 _XOPEN_SOURCE >= 600 || (_XOPEN_SOURCE && _ISOC99_SOURCE)
39 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
40 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
41 .RE
42 .ad b
43 .SH DESCRIPTION
44 These functions are deprecated: instead, use either the
45 .BR tgamma (3)
46 or the
47 .BR lgamma (3)
48 functions, as appropriate.
49 .PP
50 For the definition of the Gamma function, see
51 .BR tgamma (3).
52 .SS *BSD version
53 The libm in 4.4BSD and some versions of FreeBSD had a
54 .BR gamma ()
55 function that computes the Gamma function, as one would expect.
56 .SS glibc version
57 Glibc has a
58 .BR gamma ()
59 function that is equivalent to
60 .BR lgamma (3)
61 and computes the natural logarithm of the Gamma function.
62 .SH RETURN VALUE
63 See
64 .BR lgamma (3).
65 .SH ERRORS
66 See
67 .BR lgamma (3).
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 ()
80 T} Thread safety MT-Unsafe race:signgam
81 .TE
82 .SH CONFORMING TO
83 Because of historical variations in behavior across systems,
84 this function is not specified in any recent standard.
85 It was documented in SVID 2.
86 .SH NOTES
87 .SS History
88 4.2BSD had a
89 .BR gamma ()
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
97 .BR lgamma (3),
98 and the man page promises
99 .PP
100 .in +4n
101 "At some time in the future the name gamma will be rehabilitated
102 and used for the Gamma function"
103 .in
104 .PP
105 This did indeed happen in 4.4BSD, where
106 .BR gamma ()
107 computes the Gamma function (with no effect on
108 .IR signgam ).
109 However, this came too late, and we now have
110 .BR tgamma (3),
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.
115 .SH SEE ALSO
116 .BR lgamma (3),
117 .BR signgam (3),
118 .BR tgamma (3)