C floor() Function: Complete Rounding Guide
In the C language, the function floor is used to round down, meaning it returns the largest integer value that is less than or equal to the parameter. Its prototype is defined in the
double floor(double x);
For example, the return value of floor(5.6) would be 5.0, and the return value of floor(-3.2) would be -4.0. The floor function is mainly used to round down when converting a float to an integer.