Maths & numbers

Floor and ceiling of a number calculator

Find the neighbouring integers below and above a real value.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

For negative values, rounding down moves away from zero unless the number is already a whole integer.

THE FORMULAfloor(x) ≤ x ≤ ceil(x)

A worked example

The floor of −2.3 is −3 and its ceiling is −2.

Good to know

When the input is an integer, floor and ceiling are equal.

Find the neighbouring integers on the number line

The input −2.3 lies between −3 and −2. Its floor is the greatest integer less than or equal to it, which is −3. Its ceiling is the least integer greater than or equal to it, which is −2. The number line shows the input three tenths below −2 and seven tenths above −3.

For a positive input such as 2.3, the floor is 2 and the ceiling is 3. The definitions stay the same on both sides of zero. Thinking in terms of left and right on an increasing number line avoids treating a negative number’s floor as simply its digits with the decimal part removed.

Negative 2.3 lies between its floor of negative three and its ceiling of negative two−3 floor−2 ceiling−2.30.70.3
The lower integer is −3. The upper integer is −2. Distances from −2.3 are 0.7 and 0.3 respectively.

Distinguish rounding from removing a fractional part

Truncating −2.3 toward zero gives −2. That equals its ceiling, while truncating positive 2.3 gives 2 and equals its floor. Floor always moves downward to the integer at or below the input. Ceiling always moves upward to the integer at or above it. If the input is already an integer, both operations return that same value.

The Integer quotient and remainder calculator uses floor division so that division by a positive integer produces a nonnegative remainder. Ceiling is useful when an indivisible package must cover a requirement. If 2.3 packages would cover the quantity in an ideal divisible model, three whole packages are needed. Check the input’s units before rounding because changing units changes the integer boundaries.

A few questions, answered

How do the outputs relate for a noninteger input?

The ceiling exceeds the floor by exactly one. An integer input has equal floor and ceiling.

What happens for an input between −1 and 0?

Its floor is −1 and its ceiling is 0. For example, −0.2 lies in that interval.

Find your calculator

Start typing to explore the library.