Important: The information in this document is obsolete and should not be used for new development.
gamma
You can use thegammafunction to perform .
double_t gamma (double_t x);
x- Any positive floating-point number.
DESCRIPTION
Thegammafunction performs .
The
gammafunction reaches overflow very fast as x approaches +. For large values, use the
lgammafunction (described in the next section) instead.EXCEPTIONS
When x is finite and nonzero, either the result of is exact or it raises one of the following exceptions:
- inexact (if the result must be rounded or an overflow occurs)
- invalid (if x is a negative integer)
- overflow (if the result is outside the range of the data type)
SPECIAL CASES
Table 10-37 shows the results when the argument to thegammafunction is a zero, a NaN, or an Infinity, plus other special cases for thegammafunction.
Special cases for the gammafunctionOperation Result Exceptions raised for negative integer x NaN Invalid NaN Invalid NaN Invalid NaN None[61] + ![]()
Overflow NaN Invalid EXAMPLES
z = gamma(-1.0); /* z = NAN. The invalid exception is raised. */ z = gamma(6); /* z = 120 */
[61] If the NaN is a signaling NaN, the invalid exception is raised.