F.9.6.1 The ceil functions
ceil((+-)0) returns (+-)0.
ceil((+-)(inf)) returns (+-)(inf).
The double version of ceil behaves as though implemented by
#include <math.h>
#include <fenv.h>
#pragma STDC FENV_ACCESS ON
double ceil(double x)
{
double result;
int save_round = fegetround();
fesetround(FE_UPWARD);
result = rint(x); // or nearbyint instead of rint
fesetround(save_round);
return result;
}