man-pages/man3/gamma.3

70 lines
1.7 KiB
Groff
Raw Normal View History

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" "Linux Programmer's Manual"
2004-11-03 13:51:07 +00:00
.SH NAME
gamma, gammaf, gammal \- (logarithm of the) gamma function
.SH SYNOPSIS
.B #include <math.h>
.sp
.BI "double gamma(double " x ");"
.br
2004-11-03 13:51:07 +00:00
.BI "float gammaf(float " x ");"
.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).
.SS "*BSD version"
4.4BSD and FreeBSD libm have a
.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
.BR gamma ()
2004-11-03 13:51:07 +00:00
function that is equivalent to
.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 NOTES
.SS History
2004-11-03 13:51:07 +00:00
4.2BSD had a
.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
.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
.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
.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.
2004-11-03 13:51:07 +00:00
.SH "SEE ALSO"
.BR lgamma (3),
.BR signgam (3),
.BR tgamma (3)