What is the floor function in math?
The floor function returns the greatest integer that is less than or equal to x. It is commonly used when a fractional result must be rounded down to a whole number.
For example, floor(4.9) = 4 because 4 is the largest integer not greater than 4.9.
Properties of floor function
If x is already an integer, floor(x) equals x. If x has a decimal part, the result is the integer below it.
For negative numbers, rounding down moves farther from zero. That means floor(-2.4) = -3, not -2.
- floor(0.9) = 0
- floor(3) = 3
- floor(-1.2) = -2
Graph of the floor function
The floor function graph is a step graph. The output remains constant across each interval between consecutive integers.
The graph jumps at integer boundaries because the greatest integer less than or equal to x changes at those points.