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
|
|
|
|
.\"
|
2008-08-01 05:54:27 +00:00
|
|
|
.TH GAMMA 3 2008-08-05 "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 ");"
|
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
|
2007-07-21 05:25:03 +00:00
|
|
|
Link with \fI\-lm\fP.
|
2007-07-08 12:11:40 +00:00
|
|
|
.sp
|
|
|
|
.in -4n
|
|
|
|
Feature Test Macro Requirements for glibc (see
|
|
|
|
.BR feature_test_macros (7)):
|
|
|
|
.in
|
|
|
|
.sp
|
|
|
|
.ad l
|
2008-08-01 05:26:21 +00:00
|
|
|
.BR gamma ():
|
2010-09-19 05:02:42 +00:00
|
|
|
.RS 4
|
2008-08-01 05:26:21 +00:00
|
|
|
_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
|
2010-09-19 05:02:42 +00:00
|
|
|
.RE
|
2007-07-08 12:11:40 +00:00
|
|
|
.BR gammaf (),
|
|
|
|
.BR gammal ():
|
2010-09-19 05:02:42 +00:00
|
|
|
.RS 4
|
2008-08-01 05:26:21 +00:00
|
|
|
_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600
|
|
|
|
.\" Also seems to work: -std=c99 -D_XOPEN_SOURCE
|
2010-09-19 05:02:42 +00:00
|
|
|
.RE
|
2007-07-08 12:11:40 +00:00
|
|
|
.ad b
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
2008-08-01 05:26:21 +00:00
|
|
|
These functions are deprecated: instead, use either the
|
|
|
|
.BR tgamma (3)
|
|
|
|
or the
|
|
|
|
.BR lgamma (3)
|
|
|
|
functions, as appropriate.
|
|
|
|
|
2004-11-03 13:51:07 +00:00
|
|
|
For the definition of the Gamma function, see
|
|
|
|
.BR tgamma (3).
|
|
|
|
.SS "*BSD version"
|
2008-08-01 05:26:21 +00:00
|
|
|
The libm in 4.4BSD and some versions of FreeBSD had 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
|
2008-07-10 07:41:55 +00:00
|
|
|
.BR lgamma (3)
|
2004-11-03 13:51:07 +00:00
|
|
|
and computes the natural logarithm of the Gamma function.
|
2008-08-01 05:26:21 +00:00
|
|
|
.SH RETURN VALUE
|
|
|
|
See
|
|
|
|
.BR lgamma (3).
|
|
|
|
.SH ERRORS
|
|
|
|
See
|
|
|
|
.BR lgamma (3).
|
2007-05-19 04:30:20 +00:00
|
|
|
.SH "CONFORMING TO"
|
2008-08-01 05:26:21 +00:00
|
|
|
Because of historical variations in behavior across systems,
|
|
|
|
this function is not specified in any standard.
|
2007-05-18 11:59:14 +00:00
|
|
|
.SH NOTES
|
|
|
|
.SS History
|
2004-11-03 13:51:07 +00:00
|
|
|
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
|
2008-07-10 07:41:55 +00:00
|
|
|
.BR lgamma (3),
|
2004-11-03 13:51:07 +00:00
|
|
|
and the man page promises
|
|
|
|
.sp
|
2007-12-19 06:57:44 +00:00
|
|
|
.in +4n
|
2004-11-03 13:51:07 +00:00
|
|
|
"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
|
2008-07-10 07:41:55 +00:00
|
|
|
.BR tgamma (3),
|
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 "SEE ALSO"
|
|
|
|
.BR lgamma (3),
|
|
|
|
.BR signgam (3),
|
|
|
|
.BR tgamma (3)
|