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

Ceiling and Floor Functions

College Depth 58 in the knowledge graph ☐ I know this ☆ Set as goal
1,012topics build on this
233prerequisites beneath it
See this on the map →
Absolute Value→→Sets, 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 Zero → The Number Zero → Counting to Five → Counting to 10 → One-to-One Correspondence → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Combining Small Groups Within 5 → Addition Within 10 → Number Bonds to 10 → Tens and Ones Place Value → Reading and Writing Three-Digit Numbers → Comparing Three-Digit Numbers → Comparing and Ordering Three-Digit Quantities → Comparing and Ordering Whole Numbers → Comparing Numbers 1 to 20 → Ordering Numbers to 20 → Number Line 0 to 20 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts Through 10 → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Opposites and Additive Inverses → Absolute Value → Ceiling and Floor Functions

Longest path: 59 steps · 233 total prerequisite topics

Prerequisites (1)

Leads To (1)