floor(), floorf() - largest integral value not greater than x
#include <math.h>
double floor (double x)
float floor (float x)
The floor(3) and floorf(3) functions compute the largest integral value not greater than x.
The floor(3) and floorf(3) functions return the largest integral value expressed as a double.
If the result would cause an overflow, floor(3) returns -HUGE_VAL and sets errno. If x is +-If f or +-0, floor(3) returns the value of x.
The floor(3) function can fail for the following reasons:
abs(3)
ceil(3)
fabs(3)
ieee(3)
math(3)
rint(3)