OSDN Git Service

(split) LDP: Update original to LDP v3.38.
[linuxjm/LDP_man-pages.git] / original / 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 2008-08-05 "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 .RS 4
28 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
29 .RE
30 .BR gammaf (),
31 .BR gammal ():
32 .RS 4
33 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600
34 .\" Also seems to work: -std=c99 -D_XOPEN_SOURCE
35 .RE
36 .ad b
37 .SH DESCRIPTION
38 These functions are deprecated: instead, use either the
39 .BR tgamma (3)
40 or the
41 .BR lgamma (3)
42 functions, as appropriate.
43
44 For the definition of the Gamma function, see
45 .BR tgamma (3).
46 .SS "*BSD version"
47 The libm in 4.4BSD and some versions of FreeBSD had a
48 .BR gamma ()
49 function that computes the Gamma function, as one would expect.
50 .SS "glibc version"
51 Glibc has a
52 .BR gamma ()
53 function that is equivalent to
54 .BR lgamma (3)
55 and computes the natural logarithm of the Gamma function.
56 .SH RETURN VALUE
57 See
58 .BR lgamma (3).
59 .SH ERRORS
60 See
61 .BR lgamma (3).
62 .SH "CONFORMING TO"
63 Because of historical variations in behavior across systems,
64 this function is not specified in any standard.
65 .SH NOTES
66 .SS History
67 4.2BSD had a
68 .BR gamma ()
69 that computed
70 .RI ln(|Gamma(| x |)|),
71 leaving the sign of
72 .RI Gamma(| x |)
73 in the external integer
74 .IR signgam .
75 In 4.3BSD the name was changed to
76 .BR lgamma (3),
77 and the man page promises
78 .sp
79 .in +4n
80 "At some time in the future the name gamma will be rehabilitated
81 and used for the Gamma function"
82 .in
83 .sp
84 This did indeed happen in 4.4BSD, where
85 .BR gamma ()
86 computes the Gamma function (with no effect on
87 .IR signgam ).
88 However, this came too late, and we now have
89 .BR tgamma (3),
90 the "true gamma" function.
91 .\" The FreeBSD man page says about gamma() that it is like lgamma()
92 .\" except that is does not set signgam.
93 .\" Also, that 4.4BSD has a gamma() that computes the true gamma function.
94 .SH "SEE ALSO"
95 .BR lgamma (3),
96 .BR signgam (3),
97 .BR tgamma (3)