Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP | both | z/OS® V1.8 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 sind32(_Decimal32 x);
_Decimal64 sind64(_Decimal64 x);
_Decimal128 sind128(_Decimal128 x);
_Decimal32 sin(_Decimal32 x); /* C++ only */
_Decimal64 sin(_Decimal64 x); /* C++ only */
_Decimal128 sin(_Decimal128 x); /* C++ only */
If successful, the function returns the calculated value, expressed as a _Decimal32, _Decimal64, or _Decimal128.
If x is outside prescribed limits, the value is not calculated. Instead, the function returns 0 and sets errno to EDOM.
⁄* CELEBS69
This example illustrates the sind32() function.
*⁄
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
int main(void)
{
_Decimal32 pi, x, y;
pi = 3.141593DF;
x = pi⁄2.0DF;
y = sind32(x);
printf("sind32(%Hf) = %Hf\n", x, y);
}