Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

matherr(3m)

gamma(3m)

NAME

gamma − log gamma function

SYNTAX

#include <math.h>

double gamma(x)
double x;

DESCRIPTION

The gamma function returns ln |Γ(|x|)|. The sign of Γ(|x|) is returned in the external integer signgam. The following C program might be used to calculate Γ:

y = gamma(x);
if (y > 88.0)
error();
y = exp(y);
if(signgam)
y = −y;

ENVIRONMENT

When your program is compiled using the System V environment for nonnegative arguments, HUGE is returned, and errno is set to EDOM.  A message indicating DOMAIN error is printed on the standard error output. 

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

These error-handling procedures may be changed with the function matherr(.).

DIAGNOSTICS

A huge value is returned for negative integer arguments. 

SEE ALSO

matherr(3m)

Subroutines

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