double floor ( double x );
Round down value.
Returns the largest integer that is less than or equal to x
Floor 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.
/* floor example */
printf ("floor of 2.3 is %.1lf\n", floor (2.3) );
printf ("floor of 3.8 is %.1lf\n", floor (3.8) );
printf ("floor of -2.3 is %.1lf\n", floor (-2.3) );
printf ("floor of -3.8 is %.1lf\n", floor (-3.8) );
floor of 2.3 is 2.0
floor of 3.8 is 3.0
floor of -2.3 is -3.0
floor of -3.8 is -4.0