Rounds a number up to the closest whole number.
#include <math.h> double floor(double x); float floorf(float x); long double floorl(long double x);
x
A number to round down.
These functions return the largest integer that is not greater 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 = 12.03, y = 10.999; printf("Floor value of %f is %f.\n", x, floor(x)); printf("Floor value of %f is %f.\n", y, floor(y)); return 0; } Output: Floor value of 12.030000 is 12.000000. Floor value of 10.999000 is 10.000000.