A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Ceiling and Floor Functions

College Depth 49 in the knowledge graph I know this Set as goal
1,000topics build on this
229prerequisites beneath it
See this on the map →
Absolute ValueSets, Relations, and Functions in Discrete Mathematics
discrete-math functions notation

Core Idea

The floor function ⌊x⌋ returns the greatest integer ≤ x, while the ceiling function ⌈x⌉ returns the least integer ≥ x. These functions are essential in discrete mathematics for rounding, analyzing algorithms, and counting problems where integer solutions are required.

Explainer

The real number line is continuous — there are infinitely many values between any two integers. But discrete mathematics lives in the world of whole numbers. The floor function ⌊x⌋ and ceiling function ⌈x⌉ are the bridge between these two worlds: they take any real number and snap it to the nearest integer in a well-defined direction.

Think of floor as "round down, always." ⌊3.7⌋ = 3, ⌊−1.2⌋ = −2 (because −2 is the greatest integer *less than or equal to* −1.2 — note that for negative numbers, rounding down means going further from zero). Ceiling is "round up, always": ⌈3.2⌉ = 4, ⌈−1.7⌉ = −1. When x is exactly an integer, both functions return x itself: ⌊5⌋ = ⌈5⌉ = 5. This is important to internalize before working with them algebraically.

You already know absolute value snaps a number onto the non-negative half of the real line. Floor and ceiling are a different kind of snapping: they project onto the integers. Their power shows up in counting arguments. Suppose you have n items and want to divide them into groups of k — the number of complete groups is ⌊n/k⌋, and the number of groups needed if you can't split items is ⌈n/k⌉. This distinction is ubiquitous in algorithm analysis: if you're dividing an array of 100 elements in half repeatedly, after log₂(100) ≈ 6.64 steps you need ⌈log₂(100)⌉ = 7 actual levels.

Two useful identities to internalize: ⌊x⌋ ≤ x < ⌊x⌋ + 1, and ⌈x⌉ − 1 < x ≤ ⌈x⌉. These bounds let you convert floor/ceiling expressions into inequalities, which is how they appear in proofs. Also note that ⌈x⌉ = ⌊x⌋ + 1 when x is not an integer, and ⌈x⌉ = ⌊x⌋ when x is an integer. The relationship between the two is: ⌈x⌉ = −⌊−x⌋. This symmetry can simplify problems that initially seem to require separate cases for floor and ceiling.

Practice Questions 5 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Making 10 as an Addition StrategyAddition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts Through 10Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineOpposites and Additive InversesAbsolute ValueCeiling and Floor Functions

Longest path: 50 steps · 229 total prerequisite topics

Prerequisites (1)

Leads To (1)