Everything

tgamma / tgammaf / tgammal


Calculates the gamma function of a floating-point number.

[Format]

#include <math.h>

double tgamma(double d);

float tgammaf(float d);

long double tgammal(long double d);

[Parameters]

d Value for which the gamma function value is to be computed

[Return values]

Normal: Gamma function value of d

Abnormal: Domain error: Returns HUGE_VAL, HUGE_VALF, or HUGE_VALL with the same sign as that of d.

Range error: Returns 0, or returns +HUGE_VAL, +HUGE_VALF, or +HUGE_VALL with the mathematically correct sign depending on the function.

[Remarks]

A range error is set if the absolute value of d is too large or small.

A domain error occurs if d is a negative integer or 0 and the calculation result is not representable.