Floor and Ceiling
Learning goals
- Take the floor as the greatest integer at or below
- Round down on negatives, not toward zero
- Draw the staircase with the right open and closed ends
- Define the fractional part as
- Choose ceiling for containers and floor for full groups
What the floor and ceiling are
The floor of , written , is the greatest integer that is less than or equal to . The ceiling of , written , is the least integer that is greater than or equal to . The bent brackets are a memory aid: the floor’s brackets point down toward the ground, the ceiling’s point up.
Try a few. Since sits between and , the whole numbers at or below it are , and the greatest is , so . The whole numbers at or above are , and the least is , so . When the input is already an integer, like , it is itself the greatest integer at or below and the least integer at or above, so .
Every one of those computations used the same test: find the integer that fits snugly against from below (for the floor) or from above (for the ceiling). That test is worth writing as an inequality, because it is the engine behind everything else.
Why #
Name the floor . Two facts come straight from the definition. First, is an integer with , because the floor was chosen from among the integers that are at most . Second, the next integer up, , is bigger than , so it cannot also be one of the integers at most . If were one of those integers, then would not have been the greatest integer that is at most . So , which is the same as . Putting the two facts together,
This traps in a half-open interval of length whose left end is the floor. The floor is the only integer that does this. If some other integer also satisfied , then and would both lie within the same length- interval containing , forcing . But two different integers differ by at least , so . That uniqueness is what makes the inequality a computation tool: to find a floor, find any integer with . Because no other integer can satisfy that inequality, you can be sure that is the one and only .
The same reasoning, applied to the least integer at or above , gives the mirror statement for the ceiling:
These two inequalities also settle what happens at the boundary between the two functions. When is an integer, it is both the greatest integer at or below and the least integer at or above itself, so
When is not an integer, the left inequality becomes strict, , so lands strictly between the consecutive integers and . The least integer at or above is then , which gives a clean relationship between the two:
So the ceiling and floor are equal exactly on the integers, and exactly one apart everywhere else.
Worked example 1 Evaluate six floors and ceilings
Read each one off the number line by finding the integer that fits against the input.
For , the input sits between and , and the greatest integer at or below is , so . For , the least integer at or above is , so .
For , the input is already an integer, so .
For , the input is just above , so the least integer at or above is , giving , while .
Every answer is an integer, which is always true: the floor and ceiling only ever return whole numbers.
Rounding down is not the same as chopping off the decimal
Everything above is easy to misread once negative numbers appear, and this is the single most common mistake with these functions. “Round down” means move to the left on the number line, toward smaller values. It does not mean “delete the part after the decimal point.”
Take . It sits between and . The integers at or below are , and the greatest of them is , so
The tempting answer is wrong, because is greater than , so is not “at or below” at all. Chopping the decimal off would give , but that is rounding toward zero, not rounding down. The floor always rounds toward negative infinity. The ceiling goes the other way: the least integer at or above is , so . On the picture below, the floor is simply the tick to the left and the ceiling is the tick to the right.
Worked example 2 Evaluate floors and ceilings of negative inputs
Handle each one by asking which integer sits to the left (for the floor) and which sits to the right (for the ceiling).
The value lies between and . The greatest integer at or below is and the least integer at or above is , so and .
The value lies between and . Rounding down goes to and rounding up goes to :
For the integer input , both functions return it unchanged, . Notice the pattern for the non-integers: the floor and the ceiling of and of are always one apart, exactly as predicted.
Check your understanding
Evaluate .
The floor rounds down, toward negative infinity, so it is the nearest integer to the left of .
The answer is the tempting trap: it comes from dropping the decimal, which rounds toward zero, not down.
The graphs are staircases
To graph , group the inputs by the value they produce. The defining inequality says exactly when . So on the whole interval from up to (but not including) , the floor holds steady at the height . That makes the graph a flat horizontal segment at height running across that interval. The graph then jumps up by one at to start the next segment. The result is a staircase.
Look carefully at the ends of one step. On the interval for height , the left end is included, because , so that end is a filled (closed) dot. The right end is not included, because at the floor has already jumped to , so that end is a hollow (open) dot. Every step of the floor is therefore closed on the left and open on the right.
The ceiling graph is the same staircase read the other way. Since exactly when , each ceiling step holds the height across the interval that ends at . For a ceiling step the included end is now on the right (because ), and the excluded end is on the left. So every ceiling step is open on the left and closed on the right, the mirror image of the floor.
Both graphs pass the vertical line test (each input has one output), so they really are functions. Both accept every real number, so the domain of each is all real numbers. And every output is a whole number, with each integer height actually reached, so the range of each is the integers. The steps never connect with vertical lines, because the function does not take the in-between values during a jump. The open and closed dots are what carry that information.
Worked example 3 Solve and
Each equation asks for the whole strip of inputs that a single step covers, so read it straight off the defining inequality.
For , the floor equals exactly on the step that starts at :
Every from (included) up to (not included) has floor , and nothing else does.
For , the ceiling equals exactly on the step that ends at :
Here the left end is excluded and the right end is included, matching the open-left, closed-right shape of the ceiling staircase.
Check your understanding
Which values of satisfy ?
The ceiling equals on the step that ends at . Use with .
The left end is excluded (its ceiling is ) and the right end is included, which is the open-left, closed-right shape of a ceiling step.
The fractional part
Subtracting the floor from a number strips away the whole part and leaves only what is left over. That leftover is the fractional part of , written :
It is always at least and always less than , and the defining inequality shows exactly why. Start from with and subtract from every part:
For a positive number this matches intuition: , the digits after the decimal point. But watch what happens with a negative input, where the floor surprise strikes again. Because ,
The fractional part of is , not . It has to be, since can never be negative, and it measures how far has climbed above the step below it. On the integers the leftover is nothing at all, , which is the only time the fractional part equals .
Worked example 4 Compute and
Use , taking care with the floor of the negative input.
For , the floor is , so the leftover is the visible decimal part:
For , the floor rounds down to , not , so
Both land in as promised. And notice that and have the same fractional part , which makes sense. The two numbers are exactly apart, a whole number of steps, so they sit the same distance above their respective floors.
There is a tidy identity that ties the floor and ceiling together through a sign flip. Reflecting the number line by sending to swaps left with right. That reflection also swaps “at or below” with “at or above,” so it should turn a floor into a ceiling.
Worked example 5 Show that and use it on
Let , the least integer with . Negating both sides of reverses the inequality to . Because was the least integer at or above , the reflected value is the greatest integer at or below . That is precisely the floor of :
Negating both sides gives the identity . To use it on , compute the floor of the negated input first, then flip the sign:
That agrees with rounding up directly, and it shows you never need a separate rule for the ceiling: a floor and two sign flips always deliver it.
Check your understanding
Compute the fractional part .
Use , and remember the floor of a negative rounds down.
The floor of is , not , so the leftover is , which lands in the required range .
Where floor and ceiling show up
The reason these functions matter is counting. Whenever a real-number answer has to be turned into a whole number of things, one of the two brackets is exactly the right tool. The choice between the two brackets is never arbitrary.
Use a ceiling when every leftover still needs a full container. If students travel in vans that seat , then vans’ worth of seats are needed. But you cannot send a fractional van, and the students left over after four full vans still need one more. So the number of vans is . Buses for a crowd, pages for a list, and boxes for a shipment all work this way.
Use a floor when leftovers are discarded and you only count what is complete. From those same students you can fill vans completely. The amount left over is what the full groups do not use,
which is the same fractional-part idea from before, now scaled up by the group size. Full crates from a harvest, whole dollars from a pile of change, and complete laps around a track are all floors.
Both answers live in one picture, and it is worth building. Lay objects into rows that hold each. The number of rows that come out complete is , and the number of rows the objects occupy at all, counting a partly filled last row, is . The figure below draws those rows and hollows out any object that could not complete one.
Start at dots in rows of . Two rows fill and two dots are left hollow, so complete rows while rows are needed to hold everything. The hollow dots are the remainder, , and the third row is the one they force. Count them if you like, but it is their presence and never their number that pushes the ceiling above the floor. Two hollow dots here open a gap of one, and so would four. Widen the rows to and the same dots settle into two full rows with nothing hollow, so floor and ceiling agree at . The readout confirms why by reporting that the row width is now a factor of the count. Narrow the rows to instead and one dot is left hollow again, splitting the answers to and . Walk the row width up and down a few times and the rule becomes hard to miss. The two functions differ by exactly one whenever anything is left over, and are equal whenever the division comes out even.
Dot array
10 dots in rows of 4 make 2 full rows with 2 dots left over. So 4 is not a factor of 10.
Rounding to the nearest integer is a floor in disguise: adding first and then flooring rounds a number to its closest whole value. That works because steps up to the next integer exactly when has passed the halfway mark.
Worked example 6 Plan a field trip for students
Each bus holds students. First find how many buses are needed. Dividing gives , and the students beyond three full buses still need to ride, so round up with a ceiling:
Now suppose you instead want only the buses you can fill completely. That is a floor:
and the students left standing are , who fill the fourth bus only part way. The two answers differ by one whole bus, which is the usual gap between a ceiling and a floor when the division does not come out even.