OSDN Git Service

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