Standards / Extensions | C or C++ | Dependencies |
---|---|---|
C/C++ DFP | both | z/OS® V1.8 |
#define __STDC_WANT_DEC_FP__
#include <math.h>
_Decimal32 ceild32(_Decimal32 x);
_Decimal64 ceild64(_Decimal64 x);
_Decimal128 ceild128(_Decimal128 x);
_Decimal32 ceil(_Decimal32 x); /* C++ only */
_Decimal64 ceil(_Decimal64 x); /* C++ only */
_Decimal128 ceil(_Decimal128 x); /* C++ only */
These functions are always successful.
⁄* CELEBC50
This example illustrates the ceild32() function.
This example sets y to the smallest integer greater than
1.05, and then to the smallest integer greater than -1.05.
The results are 2.0 and -1.0, respectively.
*⁄
#define __STDC_WANT_DEC_FP__
#include <math.h>
#include <stdio.h>
int main(void)
{
_Decimal32 y, z;
y = ceild32(+1.05DF); ⁄* y = +2.0 *⁄
z = ceild32(-1.05DF); ⁄* z = -1.0 *⁄
printf("ceild32(+1.05) = % Hf\n"
"ceild32(-1.05) = % Hf\n", y, z);
}