Floor and Ceiling Advanced. This lesson goes beyond core Algebra I. You can skip it.
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 .
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,
Only one integer can do this. Consecutive integers are always a whole unit apart, so no two of them can both sit at or below while staying within one unit of it. That is what makes the inequality a computation tool: find any integer with , and it has to be .
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 integers, negative ones included.
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 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 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.
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. Lay objects into rows that hold each: 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.