.\" Copyright (c) 1985, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\" %sccs.include.redist.roff%
.\" @(#)lgamma.3 8.1 (Berkeley) %G%
.Nd log gamma function, gamma function
returns ln\||\(*G(x)| where
.Bd -unfilled -offset indent
\(*G(x) = \(is\d\s8\z0\s10\u\u\s8\(if\s10\d t\u\s8x\-1\s10\d e\u\s8\-t\s10\d dt for x > 0 and
\(*G(x) = \(*p/(\(*G(1\-x)\|sin(\(*px)) for x < 1.
returns the sign of \(*G(x).
returns \(*G(x), with no effect on
Do not use the expression
.Dq Li signgam\(**exp(lgamma(x))
Instead use a program like this (in C):
.Bd -literal -offset indent
lg = lgamma(x); g = signgam\(**exp(lg);
has returned can signgam be correct.
For arguments in its range,
is preferred, as for positive arguments
it is accurate to within one unit in the last place.
will lose up to 10 significant bits.
return appropriate values unless an arguent is out of range.
Overflow will occur for sufficiently large positive values, and
the reserved operator is returned,
For large non-integer negative values,
was originally dedicated to the
function, so some old code may no longer be compatible.