tgammad32(), tgammad64(), tgammad128() - Calculate gamma function
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP |
both | z/OS V1.10 |
Format
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 tgammad32(_Decimal32 x);
_Decimal64 tgammad64(_Decimal64 x);
_Decimal128 tgammad128(_Decimal128 x);
_Decimal32 tgamma(_Decimal32 x); /* C++ only */
_Decimal64 tgamma(_Decimal64 x); /* C++ only */
_Decimal128 tgamma(_Decimal128 x); /* C++ only */
General description
The tgamma() functions compute the gamma function of x.
These functions work in IEEE decimal floating-point format. See IEEE decimal floating-point for more information.
Note: To
use IEEE decimal floating-point, the hardware must have the Decimal
Floating-Point Facility installed.
Returned value
The tgamma functions return G(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.
Example
CELEBT24
/* CELEBT24
This example illustrates the tgammad128() function.
*/
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
int main(void)
{
_Decimal128 x, y;
x = 5.6DL;
y = tgammad128(x);
printf("tgammad128(%DDf) = %DDf\n", x, y);
}