Floor and Ceiling
Progress can't be saved in this browser, so this lesson's status can't be set.
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 integers at or below it are , and the greatest is , so . The integers 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 .
For , the two neighboring integers give . In general, if , then
The floor is at or below . The next integer, , is larger than ; since is the greatest integer at or below , must be above . Only one integer fits both bounds. An integer above is at least , too large to be at or below . For an integer , , so fails. Thus any integer satisfying is the floor.
The same reasoning, applied to the least integer at or above , gives the mirror statement for the ceiling:
An integer is its own floor and ceiling, as we saw with . In symbols,
A non-integer lies strictly between consecutive integers and . Its floor is , and its ceiling is . Therefore
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: the floor and ceiling only ever return integers, negative ones included.
Rounding down is not the same as chopping off the decimal
“Round down” means move left on the number line, toward smaller values. For negative numbers, that differs from deleting the decimal part.
Take . It sits between and . The integers at or below are , and the greatest of them is , so
The 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 comes from dropping the decimal, which rounds toward zero, not down.
The graphs are staircases
Start with . Every input in that interval has floor , so draw a horizontal step at height . Include with a filled dot, but leave open: at , the floor is already .
For any integer , the same rule gives height on . Each floor step is closed on the left and open on the right. At the next integer the height increases by one, creating a staircase.
For the ceiling, gives height . Include and leave open because . In general, height belongs to , so ceiling steps are open on the left and closed on the right. The endpoint pattern is the reverse of the floor’s.
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 an integer, 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 show which step each integer input belongs to.
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. For a negative input, remember that the floor rounds down. Because ,
The fractional part is the distance above the floor: is above . The visible is instead its distance below , the ceiling. At an integer, the input equals its floor, so the fractional part is zero: . Only integers give zero.
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 . The numbers and are exactly apart, a whole number of steps, so they sit the same distance above their floors: both have fractional part .
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 .
A ceiling can also be written using a floor: .
Where floor and ceiling show up
Floor and ceiling answer two different counting questions: how many complete groups can you make, and how many containers hold everything?
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.
You can see both answers in one picture. Lay objects into rows that hold each, with a nonnegative integer and a positive integer: the number of complete rows is , and the number of rows needed to hold everything, counting a partly filled last row, is . Try it below.
Start at dots in rows of . Two rows fill and two dots are left hollow, so while . Any leftover from one dot to three would force that same extra row, since the row width is four. Now widen the rows to : the same dots fill two rows exactly with nothing hollow, so floor and ceiling agree at . Narrow the rows to instead and one dot is hollow again, splitting the answers to and . Change the row width a few more times and watch for the pattern: the two functions differ by exactly one whenever a dot is left hollow, and are equal whenever none is.
Reading the floor and the ceiling off the rows
10 dots in rows of 4 make 2 full rows with 2 dots left over. So the floor of 10/4 is 2, and the ceiling is 3.
Worked example 5 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.
Check your understanding
A bakery packs muffins into boxes of . There are muffins to pack, and every muffin needs to go in some box. How many boxes are needed?
Every muffin needs a box, including the leftovers, so this is a ceiling problem: round up so nothing is left uncounted.
Eight boxes hold only muffins; the left over still need a ninth box. A floor of would strand those muffins, the same mistake as sending too few vans.