]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/gamma.3
Make the standard indent for code samples, shell session
[thirdparty/man-pages.git] / man3 / gamma.3
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\"
4 .\" Modified 2003-11-18, aeb: historical remarks
5 .\"
6 .TH GAMMA 3 2007-07-26 "GNU" "Linux Programmer's Manual"
7 .SH NAME
8 gamma, gammaf, gammal \- (logarithm of the) gamma function
9 .SH SYNOPSIS
10 .B #include <math.h>
11 .sp
12 .BI "double gamma(double " x ");"
13 .br
14 .BI "float gammaf(float " x ");"
15 .br
16 .BI "long double gammal(long double " x ");"
17 .sp
18 Link with \fI\-lm\fP.
19 .sp
20 .in -4n
21 Feature Test Macro Requirements for glibc (see
22 .BR feature_test_macros (7)):
23 .in
24 .sp
25 .ad l
26 .BR gamma (),
27 .BR gammaf (),
28 .BR gammal ():
29 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
30 .ad b
31 .SH DESCRIPTION
32 For the definition of the Gamma function, see
33 .BR tgamma (3).
34 .SS "*BSD version"
35 4.4BSD and FreeBSD libm have a
36 .BR gamma ()
37 function that computes the Gamma function, as one would expect.
38 .SS "glibc version"
39 Glibc has a
40 .BR gamma ()
41 function that is equivalent to
42 .BR lgamma ()
43 and computes the natural logarithm of the Gamma function.
44 (This is for compatibility reasons only.
45 Don't use this function.)
46 .SH "CONFORMING TO"
47 4.2BSD.
48 Compatible with previous mistakes.
49 .SH NOTES
50 .SS History
51 4.2BSD had a
52 .BR gamma ()
53 that computed
54 .RI ln(|Gamma(| x |)|),
55 leaving the sign of
56 .RI Gamma(| x |)
57 in the external integer
58 .IR signgam .
59 In 4.3BSD the name was changed to
60 .BR lgamma (),
61 and the man page promises
62 .sp
63 .in +4n
64 "At some time in the future the name gamma will be rehabilitated
65 and used for the Gamma function"
66 .in
67 .sp
68 This did indeed happen in 4.4BSD, where
69 .BR gamma ()
70 computes the Gamma function (with no effect on
71 .IR signgam ).
72 However, this came too late, and we now have
73 .BR tgamma (),
74 the "true gamma" function.
75 .\" The FreeBSD man page says about gamma() that it is like lgamma()
76 .\" except that is does not set signgam.
77 .\" Also, that 4.4BSD has a gamma() that computes the true gamma function.
78 .SH "SEE ALSO"
79 .BR lgamma (3),
80 .BR signgam (3),
81 .BR tgamma (3)