]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/tgamma.3
Automated unformatting of parentheses using unformat_parens.sh
[thirdparty/man-pages.git] / man3 / tgamma.3
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\" Based on glibc infopages
4 .\" Modified 2004-11-15, fixed error noted by Fabian Kreutz
5 .\" <kreutz@dbs.uni-hannover.de>
6 .TH TGAMMA 3 2004-11-15 "GNU" "libc math functions"
7 .SH NAME
8 tgamma, tgammaf, tgammal \- true gamma function
9 .SH SYNOPSIS
10 .B #include <math.h>
11 .sp
12 .BI "double tgamma(double " x );
13 .br
14 .BI "float tgammaf(float " x );
15 .br
16 .BI "long double tgammal(long double " x );
17 .sp
18 Compile with \-std=c99; link with \-lm.
19 .SH DESCRIPTION
20 The Gamma function is defined by
21 .sp
22 Gamma(x) = integral from 0 to infinity of t^(x\-1) e^\-t dt
23 .sp
24 It is defined for every real number except for nonpositive integers.
25 For nonnegative integral \fIm\fP one has
26 .sp
27 Gamma(m+1) = m!
28 .sp
29 and, more generally, for all \fIx\fP:
30 .sp
31 Gamma(x+1) = x * Gamma(x)
32 .sp
33 Furthermore, the following is valid for all values of \fIx\fP
34 outside the poles:
35 .sp
36 Gamma(x) * Gamma(1\-x) = PI/sin(PI*x)
37 .PP
38 This function returns the value of the Gamma function for the
39 argument \fIx\fP. It had to be called "true gamma function"
40 since there is already a function
41 .IR gamma ()
42 that returns something else.
43 .SH ERRORS
44 In order to check for errors, set
45 .I errno
46 to zero and call
47 .I feclearexcept(FE_ALL_EXCEPT)
48 before calling these functions. On return, if
49 .I errno
50 is non-zero or
51 .I fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW)
52 is non-zero, an error has occurred.
53 .LP
54 A range error occurs if x is too large.
55 A pole error occurs if x is zero.
56 A domain error (or a pole error) occurs if x is a negative integer.
57 .SH "CONFORMING TO"
58 C99.
59 .SH "SEE ALSO"
60 .BR gamma (3),
61 .BR lgamma (3)