Rounds a number up to the closest whole number.
#include <math.h> double ceil(double x); float ceilf(float x); long double ceill(long double x);
x
A number to round up.
These functions return the smallest integer that is not less than x.
This facility may not be available on configurations of the EWL that run on platforms that do not have floating-point math capabilities.
#include <math.h> #include <stdio.h> int main(void) { double x = 100.001, y = 9.99; printf("The ceiling of %f is %f.\n", x, ceil(x)); printf("The ceiling of %f is %f.\n", y, ceil(y)); return 0; } Output: The ceiling of 100.001000 is 101.000000. The ceiling of 9.990000 is 10.000000.