![]() |
VOOZH | about |
The tgamma() function is defined in header math.h header in C and cmath library in C++. This function is used to compute the gamma function of an argument passed to the function.
float tgamma(float x); double tgamma(double x); long double tgamma(long double x);
x: The value whose gamma function is to be computed. It can be float, double or long double.
There are two types of errors that usually occur with tgamma() method:
Below example demonstrate the use of tgamma() function in C/C++:
Output
For x = 0.000000, tgamma(x) = inf For x = -inf, tgamma(x) = nan For x = inf, tgamma(x) = inf For x = -nan, tgamma(x) = -nan