man-pages/man3/gamma.3

67 lines
1.7 KiB
Groff

.\" 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 ");"
.br
.BI "float gammaf(float " x ");"
.br
.BI "long double gammal(long double " x ");"
.sp
Link with \-lm.
.SH DESCRIPTION
For the definition of the Gamma function, see
.BR tgamma (3).
.SS "*BSD version"
4.4BSD and FreeBSD libm have a
.BR gamma ()
function that computes the Gamma function, as one would expect.
.SS "glibc version"
Glibc has a
.BR gamma ()
function that is equivalent to
.BR lgamma ()
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
.BR gamma ()
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
.BR lgamma (),
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
.BR gamma ()
computes the Gamma function (with no effect on
.IR signgam ).
However, this came too late, and we now have
.BR tgamma (),
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)