mirror of https://github.com/mkerrisk/man-pages
101 lines
2.3 KiB
Groff
101 lines
2.3 KiB
Groff
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
|
|
.\"
|
|
.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
|
|
.\" Distributed under GPL
|
|
.\" %%%LICENSE_END
|
|
.\"
|
|
.\" Modified 2003-11-18, aeb: historical remarks
|
|
.\"
|
|
.TH GAMMA 3 2008-08-05 "GNU" "Linux Programmer's Manual"
|
|
.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 \fI\-lm\fP.
|
|
.sp
|
|
.in -4n
|
|
Feature Test Macro Requirements for glibc (see
|
|
.BR feature_test_macros (7)):
|
|
.in
|
|
.sp
|
|
.ad l
|
|
.BR gamma ():
|
|
.RS 4
|
|
_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
|
|
.RE
|
|
.BR gammaf (),
|
|
.BR gammal ():
|
|
.RS 4
|
|
_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600
|
|
.\" Also seems to work: -std=c99 -D_XOPEN_SOURCE
|
|
.RE
|
|
.ad b
|
|
.SH DESCRIPTION
|
|
These functions are deprecated: instead, use either the
|
|
.BR tgamma (3)
|
|
or the
|
|
.BR lgamma (3)
|
|
functions, as appropriate.
|
|
|
|
For the definition of the Gamma function, see
|
|
.BR tgamma (3).
|
|
.SS *BSD version
|
|
The libm in 4.4BSD and some versions of FreeBSD had 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 (3)
|
|
and computes the natural logarithm of the Gamma function.
|
|
.SH RETURN VALUE
|
|
See
|
|
.BR lgamma (3).
|
|
.SH ERRORS
|
|
See
|
|
.BR lgamma (3).
|
|
.SH CONFORMING TO
|
|
Because of historical variations in behavior across systems,
|
|
this function is not specified in any standard.
|
|
.SH NOTES
|
|
.SS 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 (3),
|
|
and the man page promises
|
|
.sp
|
|
.in +4n
|
|
"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 (3),
|
|
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 SEE ALSO
|
|
.BR lgamma (3),
|
|
.BR signgam (3),
|
|
.BR tgamma (3)
|