2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
|
|
|
|
.\" Distributed under GPL
|
|
|
|
.\"
|
|
|
|
.\" Modified 2003-11-18, aeb: historical remarks
|
|
|
|
.\"
|
|
|
|
.TH GAMMA 3 2002-08-10 "GNU" "libc math functions"
|
|
|
|
.SH NAME
|
|
|
|
gamma, gammaf, gammal \- (logarithm of the) gamma function
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B #include <math.h>
|
|
|
|
.sp
|
|
|
|
.BI "double gamma(double " x ");"
|
2004-11-11 17:28:42 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "float gammaf(float " x ");"
|
2004-11-11 17:28:42 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "long double gammal(long double " x ");"
|
|
|
|
.sp
|
|
|
|
Link with \-lm.
|
|
|
|
.SH DESCRIPTION
|
|
|
|
For the definition of the Gamma function, see
|
|
|
|
.BR tgamma (3).
|
|
|
|
.PP
|
|
|
|
.SS "*BSD version"
|
|
|
|
4.4BSD and FreeBSD libm have a
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR gamma ()
|
2004-11-03 13:51:07 +00:00
|
|
|
function that computes the Gamma function, as one would expect.
|
|
|
|
.SS "glibc version"
|
|
|
|
Glibc has a
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR gamma ()
|
2004-11-03 13:51:07 +00:00
|
|
|
function that is equivalent to
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR lgamma ()
|
2004-11-03 13:51:07 +00:00
|
|
|
and computes the natural logarithm of the Gamma function.
|
|
|
|
(This is for compatibility reasons only. Don't use this function.)
|
|
|
|
.SH HISTORY
|
|
|
|
4.2BSD had a
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR gamma ()
|
2004-11-03 13:51:07 +00:00
|
|
|
that computed
|
|
|
|
.RI ln(|Gamma(| x |)|),
|
|
|
|
leaving the sign of
|
|
|
|
.RI Gamma(| x |)
|
|
|
|
in the external integer
|
|
|
|
.IR signgam .
|
|
|
|
In 4.3BSD the name was changed to
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR lgamma (),
|
2004-11-03 13:51:07 +00:00
|
|
|
and the man page promises
|
|
|
|
.sp
|
|
|
|
.in +3
|
|
|
|
"At some time in the future the name gamma will be rehabilitated
|
|
|
|
and used for the Gamma function"
|
|
|
|
.in
|
|
|
|
.sp
|
|
|
|
This did indeed happen in 4.4BSD, where
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR gamma ()
|
2004-11-03 13:51:07 +00:00
|
|
|
computes the Gamma function (with no effect on
|
|
|
|
.IR signgam ).
|
|
|
|
However, this came too late, and we now have
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR tgamma (),
|
2004-11-03 13:51:07 +00:00
|
|
|
the "true gamma" function.
|
|
|
|
.\" The FreeBSD man page says about gamma() that it is like lgamma()
|
|
|
|
.\" except that is does not set signgam.
|
|
|
|
.\" Also, that 4.4BSD has a gamma() that computes the true gamma function.
|
|
|
|
.SH "CONFORMING TO"
|
|
|
|
4.2BSD. Compatible with previous mistakes.
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR lgamma (3),
|
|
|
|
.BR signgam (3),
|
|
|
|
.BR tgamma (3)
|