double ceil ( double x );
Round up a value.
Returns the smallest integer that is greater or equal to x
Ceiling of x.
Defined in ANSI-C.
ANSI-C++ adds float and double overloaded versions of this function, with the same bahavior but being both, parameter and result, of one of these types.
/* ceil example */
printf ("ceil of 2.3 is %.1lf\n", ceil (2.3) );
printf ("ceil of 3.8 is %.1lf\n", ceil (3.8) );
printf ("ceil of -2.3 is %.1lf\n", ceil (-2.3) );
printf ("ceil of -3.8 is %.1lf\n", ceil (-3.8) );
ceil of 2.3 is 3.0
ceil of 3.8 is 4.0
ceil of -2.3 is -2.0
ceil of -3.8 is -3.0