Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ gamma(3M) — sysv — mips UMIPS RISC/os 4.52

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exp(3F)

values(5)



GAMMA(3M-SysV)      RISC/os Reference Manual       GAMMA(3M-SysV)



NAME
     gamma - log gamma function

SYNOPSIS
     #include <math.h>

     double gamma (x)
     double x;

     extern int signgam;

DESCRIPTION
     gamma returns ln(|gamma(x)|), where gamma(x) is defined as
     the sum from zero to infinity of (e to the power of -t)(t to
     the power of x-1)(dt).  The sign of gamma(x) is returned in
     the external integer signgam.  The argument x may not be a
     non-positive integer.

     The following C program fragment might be used to calculate
     gamma:


          if ((y = gamma(x)) > LN_MAXDOUBLE)
               error();
          y = signgam * exp(y);

     where LN_MAXDOUBLE is the least value that causes exp(3F) to
     return a range error, and is defined in the <values.h>
     header file.

SEE ALSO
     exp(3F), values(5).

DIAGNOSTICS
     For non-negative integer arguments HUGE is returned, and
     errno is set to EDOM.  A message indicating SING error is
     printed on the standard error output.

     If the correct value would overflow, gamma returns HUGE and
     sets errno to ERANGE.















                         Printed 1/15/91                   Page 1



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