Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP |
both | z/OS® V1.10 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 remainderd32(_Decimal32 x, _Decimal32 y);
_Decimal64 remainderd64(_Decimal64 x, _Decimal64 y);
_Decimal128 remainderd128(_Decimal128 x, _Decimal128 y);
_Decimal32 remainder(_Decimal32 x, _Decimal32 y); /* C++ only */
_Decimal64 remainder(_Decimal64 x, _Decimal64 y); /* C++ only */
_Decimal128 remainder(_Decimal128 x, _Decimal128 y); /* C++ only */
These functions work in IEEE decimal floating-point format. See IEEE decimal floating-point for more information.
If successful, remainder() returns the remainder of the division of x by y.
If y is zero, remainder() returns NaNQ and sets errno to EDOM.
⁄* CELEBR23
This example illustrates the remainderd32() function.
*⁄
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
void main() {
_Decimal32 n1=3.0DF, n2=3.5DF;
printf("Illustrates the remainderd32() function\n");
printf("remainderd32(%.2Hf,%.2Hf)=%.2Hf\n",n1,n2,remainderd32(n1,n2));
n1=1.0DF; n2=2.0DF;
printf("remainderd32(%.2Hf,%.2Hf)=%.2Hf\n",n1,n2,remainderd32(n1,n2));
n1=1.0DF; n2=0.0DF;
printf("remainderd32(%.2Hf,%.2Hf)=%.2Hf\n",n1,n2,remainderd32(n1,n2));
}