Section: Linux Programmer's Manual (3)
Return to Main Contents
gamma, gammaf, gammal - (logarithm of the) gamma function
double gamma(double x);
float gammaf(float x);
long double gammal(long double x);
Link with -lm.
Feature Test Macro Requirements for glibc (see
_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600
These functions are deprecated: instead, use either the
functions, as appropriate.
For the definition of the Gamma function, see
The libm in 4.4BSD and some versions of FreeBSD had a
function that computes the Gamma function, as one would expect.
Glibc has a
function that is equivalent to
and computes the natural logarithm of the Gamma function.
Because of historical variations in behavior across systems,
this function is not specified in any standard.
4.2BSD had a
leaving the sign of
in the external integer
In 4.3BSD the name was changed to
and the man page promises
"At some time in the future the name gamma will be rehabilitated
and used for the Gamma function"
This did indeed happen in 4.4BSD, where
computes the Gamma function (with no effect on
However, this came too late, and we now have
the "true gamma" function.
This page is part of release 3.74 of the Linux
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
- *BSD version
- glibc version
- RETURN VALUE
- CONFORMING TO
- SEE ALSO