Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP | both | z/OS® V1.8 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 floord32(_Decimal32 x);
_Decimal64 floord64(_Decimal64 x);
_Decimal128 floord128(_Decimal128 x);
_Decimal32 floor(_Decimal32 x); /* C++ only */
_Decimal64 floor(_Decimal64 x); /* C++ only */
_Decimal128 floor(_Decimal128 x); /* C++ only */
Returns the calculated integral value expressed as a _Decimal32, _Decimal64, or _Decimal128 value. The result cannot have a range error.
⁄* CELEBF78
This example illustrates the floord64() function.
This example assigns y the value of the largest integer that is less
than or equal to 2.8, and it assigns z the value of the largest
integer that is less than or equal to -2.8.
*⁄
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
int main(void)
{
_Decimal64 y, z;
y = floord64(+2.8DD);
z = floord64(-2.8DD);
printf("floord64(+2.8) = %+Df\n", y);
printf("floord64(-2.8) = %+Df\n", z);
}