Floor and Ceiling Functions¶
Definition¶
For a real number , the floor of is the largest integer less than or equal to , and the ceiling of is the smallest integer greater than or equal to :
Equivalently, for an integer , exactly when , and exactly when . Both are functions from to .
Interpretation¶
The floor rounds down and the ceiling rounds up to the nearest integer. On the number line, is the integer at or immediately to the left of and the integer at or immediately to the right.
"Down" means towards , not towards . The name integer part usually means , but for negative numbers some texts instead mean truncation towards zero, which differs: , while truncation gives . For the same reason is not unless is an integer.
The graphs are staircases. On each interval the floor is constant, so it is continuous at every non-integer; at each integer it jumps up by . This makes the floor a standard example for one-sided limits and one-sided continuity: the filled dot of each step sits at its left end, so the function agrees with its limit from the right.
The floor (solid blue) has its filled dots at the left ends of the steps; the ceiling (dashed red) is constant on each and has its filled dots at the right ends, so it is left-continuous instead. At an integer both take the value . The thin grey line runs between the two staircases, which is the inequality , and the vertical line at meets the floor at and the ceiling at , as in the first example.
Move , or type an integer: the floor and ceiling are the integers on either side of and coincide only when is an integer. For negative , compare the floor with truncation towards . The last view shows the fractional part , which has period .
Key Results¶
- For every , , and the two non-strict inequalities are equalities exactly when is an integer.
- is if is an integer and otherwise.
- , and for every integer . In general the floor is not additive: .
- Both functions are nondecreasing step functions that jump by at each integer. At an integer , and , so the two-sided limit does not exist. The floor is right-continuous but not left-continuous at every integer; the ceiling is left-continuous but not right-continuous there.
- From and the squeeze theorem, as .
- For , counts the positive integers in .
- The fractional part lies in and is periodic with period .
Examples¶
- , , , and .
- At , for but , so the left-hand one-sided limit is while the right-hand limit is .
- Additivity fails: , but .
- The number of multiples of in is .
- In branch-and-bound, a fractional LP value is excluded by the two branches and .
- In life insurance, the curtate future lifetime is , the number of complete future years: a future lifetime gives , and exactly when .
Prerequisites¶
Related Concepts¶
- One-Sided Limit
- One-Sided Continuity
- Monotone Function
- Periodic Function
- Branch-and-Bound
- Curtate Future Lifetime
Sources¶
- Math I: Calculus · Lecture 5 (frame "Floor and ceiling functions")
Aliases: floor function, ceiling function, integer part Keywords: greatest integer function, rounding down, rounding up, fractional part, step function, jump discontinuity Symbols: element of, infinity, integers, real numbers
Last updated: 17 October 2026 21:53
Floor and Ceiling FunctionsIntegerReal NumberFunctionOne-Sided LimitOne-Sided ContinuityMonotone FunctionPeriodic FunctionBranch-and-BoundCurtate Future Lifetime