Compute the greatest integer less than or equal to x, with comparisons to ceiling, rounding, and truncation.
Last updated: June 2026 | By Patchworkr Team
Floor returns the greatest integer that does not exceed the input. It is different from truncation when the input is negative.
The fractional part is x - floor(x), and it is always between 0 and 1 for real x.
Example: floor(3.7) = 3 and floor(-2.3) = -3.
Evaluate floor(-2.3).
1. The exact value is -2.3.
2. The greatest integer less than or equal to -2.3 is -3.
3. This is different from truncation, which would give -2.
Final answer: -3
Related Tools