Loading...
Select Version
&pagelevel(4)&pagelevel
Definition | #include <math.h> double ceil(double x); These functions round up a floating-point number to an integer value. | |
Return val. | Lowest integer in floating point format which is greater than or equal to x | |
Example | #include <math.h>
#include <stdio.h>
int main(void)
{ double x; printf("Please enter the floating-point number to be rounded up:\n");
if (scanf("%lf", &x) == 1) printf("The number %g is being rounded up to %f\n", x, ceil(x));
return 0;
}
| |
See also | abs, fabs, floor | |