Floor Function Calculator
Test cases replayed : 3 of 3 match · Methodology · No outside source listed
Enter any real number to get its floor (greatest integer ≤ x), its ceiling, its rounded and truncated values, and its fractional part.
Result
Floor ⌊x⌋
Ceiling ⌈x⌉
- Rounded (halves go up)
- Truncated (integer part toward 0)
- Fractional part x − ⌊x⌋
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- x (real number): enter a number.
- Read the result: Floor ⌊x⌋; the panel also shows Ceiling ⌈x⌉, Rounded (halves go up), Truncated (integer part toward 0) and Fractional part x − ⌊x⌋.
How this calculator works
The floor function ⌊x⌋ is the greatest integer less than or equal to x; the ceiling ⌈x⌉ is the least integer greater than or equal to x (notation of Kenneth Iverson, 1962).
For negative numbers floor and truncation differ: truncation drops the decimals and moves toward 0, while floor always moves down. The fractional part {x} = x − ⌊x⌋ is always between 0 and 1. Rounding here takes halves up: ⌊x + 0.5⌋.
The formula
| Symbol | Meaning |
|---|---|
| x (real number) | |
| Floor ⌊x⌋ | |
floor(x) | the largest whole number not above x. |
Worked example
| x (real number) | -3.7 |
|---|
| Ceiling ⌈x⌉ | -3 |
|---|---|
| Rounded (halves go up) | -4 |
| Truncated (integer part toward 0) | -3 |
| Fractional part x − ⌊x⌋ | 0.3 |
Floor ⌊x⌋ -4
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
What is the floor of −3.7?
−4, because −4 is the greatest integer below −3.7. Its ceiling is −3 and its fractional part is 0.3.
Is the floor function the same as rounding down?
Yes. Floor always rounds toward negative infinity, which is rounding down for both positive and negative numbers.