How this calculation works
For negative values, rounding down moves away from zero unless the number is already a whole integer.
floor(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.
Reference: OpenStax Prealgebra (opens in a new tab) ↗
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.
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.