about summary refs log tree commit diff
path: root/manual/math.texi
diff options
context:
space:
mode:
Diffstat (limited to 'manual/math.texi')
-rw-r--r--manual/math.texi29
1 files changed, 25 insertions, 4 deletions
diff --git a/manual/math.texi b/manual/math.texi
index 4386c2fefc..e1d597d06a 100644
--- a/manual/math.texi
+++ b/manual/math.texi
@@ -857,7 +857,8 @@ The sign of the gamma function is stored in the global variable
 the intermediate result was positive or zero, and, @code{-1} if it was
 negative.
 
-You can compute the actual gamma function as follows:
+To compute the real gamma function you can use the @code{tgamma}
+function or you can compute the values as follows:
 @smallexample
 lgam = lgamma(x);
 gam  = signgam*exp(lgam);
@@ -878,15 +879,35 @@ the intermediate result in the variable pointed to by @var{signp}
 instead of in the @var{signgam} global.
 @end deftypefun
 
-@ignore
 @comment math.h
 @comment SVID
 @deftypefun double gamma (double @var{x})
 @deftypefunx float gammaf (float @var{x})
 @deftypefunx {long double} gammal (long double @var{x})
-??? _not_ exp(lgamma())*signgam - historical?
+These functions exist for compatibility reasons.  They are equivalent to
+@code{lgamma} etc.  It is better to use @code{lgamma} since for one the
+name reflect better the actual computation and @code{lgamma} is also
+standardized in @w{ISO C 9x} while @code{gamma} is not.
+@end deftypefun
+
+@comment math.h
+@comment XPG
+@deftypefun double tgamma (double @var{x})
+@deftypefunx float tgammaf (float @var{x})
+@deftypefunx {long double} tgammal (long double @var{x})
+@code{tgamma} applies the gamma function to @var{x}.  The gamma
+function is defined as
+@tex
+$$\Gamma(x) = \int_0^\infty t^{x-1} e^{-t} \hbox{d}t$$
+@end tex
+@ifnottex
+@smallexample
+gamma (x) = integral from 0 to @infinity{} of t^(x-1) e^-t dt
+@end smallexample
+@end ifnottex
+
+This function was introduced in @w{ISO C 9x}.
 @end deftypefun
-@end ignore
 
 @comment math.h
 @comment SVID