Manpage of GAMMA
1.17 `gamma', `gammaf', `lgamma', `lgammaf', `gamma_r',
The sign of the result is returned in the global variable `signgam',
which is declared in math.h.
`gammaf' performs the same calculation as `gamma', but uses and
returns `float' values.
`lgamma' and `lgammaf' are alternate names for `gamma' and `gammaf'.
The use of `lgamma' instead of `gamma' is a reminder that these
functions compute the log of the gamma function, rather than the gamma
function itself.
The functions `gamma_r', `gammaf_r', `lgamma_r', and `lgammaf_r' are
just like `gamma', `gammaf', `lgamma', and `lgammaf', respectively, but
take an additional argument. This additional argument is a pointer to
an integer. This additional argument is used to return the sign of the
result, and the global variable `signgam' is not used. These functions
may be used for reentrant calls (but they will still set the global
variable `errno' if an error occurs).
When X is a nonpositive integer, `gamma' returns `HUGE_VAL' and
`errno' is set to `EDOM'. If the result overflows, `gamma' returns
`HUGE_VAL' and `errno' is set to `ERANGE'.
You can modify this error treatment using `matherr'.
will give you access to the complete manual.