tgamma(), tgammaf(), tgammal() — Calculate gamma function

Standards

Standards / Extensions C or C++ Dependencies

C99
Single UNIX Specification, Version 3
C++ TR1 C99

both z/OS V1R5

Format

#define _ISOC99_SOURCE
#include <math.h>

double tgamma(double x);
float tgammaf(float x);
long double tgammal(long double x);
C++ TR1 C99
#define _TR1_C99
#include <math.h>

float tgamma(float x); 
long double tgamma(long double x);

General description

The tgamma functions compute the gamma function of x. A domain error occurs if x is a negative integer or when x is zero and the result cannot be represented. A range error occurs if the magnitude of x is too large or too small.
Note: The following table shows the viable formats for these functions. See IEEE binary floating-point for more information about IEEE Binary Floating-Point.
Function Hex IEEE
tgamma X X
tgammaf X X
tgammal X X

Special behavior for IEEE: A pole error occurs if the input of tgammaf is 0 and sets errno to ERANGE. A domain error occurs if the input of tgammaf is a negative integer and sets errno to EDOM.

Returned value

The tgamma functions return G(x).