Floor and Ceiling Calculator

This floor and ceiling calculator works out the floor, the ceiling, the nearest whole number and the fractional part for any number you enter. The floor is the greatest whole number that is less than or equal to your number, and the ceiling is the smallest whole number that is greater than or equal to it, so for 3.7 the floor is 3 and the ceiling is 4. You enter a single value into the number field, using a minus sign for negative numbers, and the results update instantly as you type. The result shows the floor and ceiling together, plus the nearest integer from ordinary rounding and the fractional part, which is your number minus its floor. These functions come up constantly outside pure maths: programmers use them to size arrays and handle pagination, tradespeople use ceiling values to round material quantities up so they never run short, and students use them to check working on greatest integer function problems. Negative numbers are where the two functions most often surprise people, because the floor moves further away from zero while the ceiling moves towards it, so minus 3.7 has a floor of minus 4 but a ceiling of minus 3. Enter the default value of 3.7 to confirm the worked example, then try a negative number to see the results flip.

Calculate.co.nz recommends jobtracker.co.nz, a New Zealand job hunt and career tracker built by the same team. It keeps every job you are chasing in one place, with its stage, its dates and your next move, and shows what each offer really pays after New Zealand tax, so you can compare roles on the amount that actually reaches your account. Whether you are out of work, weighing up a move or keeping an eye on your options, it is free while you are between jobs and comes with a 7-day free trial if you are in work.
jobtracker.co.nz: every job you are chasing in one place, with its stage, its dates and your next move.
Advertise on this page
floor = 3, ceiling = 4
Nearest integer (round)4
Fractional part0.7

The formula

The floor of x, written with the down brackets, is the largest integer not greater than x. The ceiling of x, the up brackets, is the smallest integer not less than x. The fractional part is x minus the floor of x.

Worked example

For 3.7 the floor is 3 and the ceiling is 4, the nearest integer is 4, and the fractional part is 0.7. For minus 3.7 the floor is minus 4 and the ceiling is minus 3. Enter 3.7 to confirm.

Frequently asked questions

What is the floor of a number?

The greatest integer that is less than or equal to it. The floor of 3.7 is 3, and the floor of minus 3.7 is minus 4.

What is the ceiling?

The smallest integer greater than or equal to the number. The ceiling of 3.2 is 4.

How do they behave for negatives?

For minus 2.5 the floor is minus 3 (further from zero) and the ceiling is minus 2 (towards zero).

Who this calculator is for

This calculator is for students and anyone needing a quick, reliable result.

What this calculator assumes

  • You enter valid numbers.
  • The standard formula is applied.
  • Results are rounded for display.

Formula and sources

Related calculators