tgamma(), tgammaf(), tgammal()

Compute the gamma function of a number

Synopsis:

#include <math.h>

double tgamma( double x );

float tgammaf( float x );

long double tgammal( long double x );

Arguments:

x
An arbitrary number.

Library:

libm

Use the -l m option to qcc to link against this library.

Description:

The tgamma(), tgammaf(), and tgammal() functions compute Γ(x), which is defined as follows:

To check for error situations, use feclearexcept() and fetestexcept():

Returns:

The gamma of x.

Errors:

FE_DIVBYZERO
The x argument is 0.
FE_INVALID
The value of x argument is a negative integer, or x is -Inf.
FE_OVERFLOW
The result would cause an overflow.
FE_UNDERFLOW
The value of x isn't equal to y, and the correct function value is subnormal, zero, or underflows.

Classification:

ANSI, POSIX 1003.1

Safety:  
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes