]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/tgamma.3
Make "manual" in .TH line "Linux Programmers Manual"
[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" "Linux Programmer's Manual"
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 non-positive integers.
25 For non-negative 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.
40 It had to be called "true gamma function"
41 since there is already a function
42 .BR gamma (3)
43 that returns something else.
44 .SH ERRORS
45 In order to check for errors, set
46 .I errno
47 to zero and call
48 .I feclearexcept(FE_ALL_EXCEPT)
49 before calling these functions.
50 On return, if
51 .I errno
52 is non-zero or
53 .I fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW)
54 is non-zero, an error has occurred.
55 .LP
56 A range error occurs if x is too large.
57 A pole error occurs if x is zero.
58 A domain error (or a pole error) occurs if x is a negative integer.
59 .SH "CONFORMING TO"
60 C99.
61 .SH "SEE ALSO"
62 .BR gamma (3),
63 .BR lgamma (3)