Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ lgamma(3) — BSD/386 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

math(3)

infnan(3)

LGAMMA(3)                   BSD Programmer's Manual                  LGAMMA(3)

NAME
     lgamma gamma - log gamma function, gamma function

SYNOPSIS
     #include <math.h>

     extern int signgam;

     double
     lgamma(double x)

     double
     gamma(double x)

DESCRIPTION
     Lgamma(x) returns ln|(x)|.

     The external integer signgam returns the sign of (x).

     Gamma(x) returns (x), with no effect on signgam.

IDIOSYNCRASIES
     Do not use the expression ``signgam*exp(lgamma(x))'' to compute g := (x).
     Instead use a program like this (in C):

           lg = lgamma(x); g = signgam*exp(lg);

     Only after lgamma() has returned can signgam be correct.

     For arguments in its range, gamma() is preferred, as for positive argu-
     ments it is accurate to within one unit in the last place.  Exponentia-
     tion of lgamma() will lose up to 10 significant bits.

RETURN VALUES
     Gamma() and lgamma() return appropriate values unless an arguent is out
     of range.  Overflow will occur for sufficiently large positive values,
     and non-positive integers.  On the VAX, the reserved operator is re-
     turned, and errno is set to ERANGE For large non-integer negative values,
     gamma() will underflow.

SEE ALSO
     math(3),  infnan(3)

HISTORY
     The lgamma function appeared in 4.3BSD. The gamma function appeared in
     4.4BSD. The name gamma() was originally dedicated to the lgamma() func-
     tion, so some old code may no longer be compatible.

4.3 Berkeley Distribution       March 26, 1993                               1















Typewritten Software • bear@typewritten.org • Edmonds, WA 98026