The Big Idea
A real value can fall anywhere on the continuous number line, while many decisions require an integer. We cannot purchase \(4.2\) buses, assign \(7.6\) complete rows, or process a fraction of a full production batch as though it were complete.
The floor function selects the greatest integer at or below a number. The ceiling function selects the least integer at or above it:
\[ \lfloor x\rfloor =\text{greatest integer not exceeding }x, \] \[ \lceil x\rceil =\text{least integer not less than }x. \]
In practical language, floor moves down to the integer grid and ceiling moves up to the integer grid. “Down” and “up” refer to numerical order, not merely to deleting or increasing digits.
Start with the Neighboring Integers
If \(x=4.7\), the neighboring integers are \(4\) and \(5\):
\[ \lfloor4.7\rfloor=4, \qquad \lceil4.7\rceil=5. \]
If the input is already an integer, both functions return it:
\[ \lfloor5\rfloor=5, \qquad \lceil5\rceil=5. \]
The functions do not always change a value. They change it only when the input lies between integers.
Negative Inputs Require Order, Not Digit Tricks
The number \(-2.3\) lies between \(-3\) and \(-2\):
\[ -3<-2.3<-2. \]
Therefore,
\[ \lfloor-2.3\rfloor=-3, \qquad \lceil-2.3\rceil=-2. \]
Floor moves toward \(-\infty\), so the floor of a negative noninteger becomes more negative. Ceiling moves toward \(+\infty\), so its result becomes less negative.
The Step Graphs
Each horizontal step represents all inputs that share one integer output. A closed circle includes an endpoint; an open circle excludes it.
They Are Functions from Real Inputs to Integer Outputs
Both functions accept every real number and return an integer:
\[ \lfloor\cdot\rfloor:\mathbb R\to\mathbb Z, \qquad \lceil\cdot\rceil:\mathbb R\to\mathbb Z. \]
Every integer occurs as an output, so both functions are onto \(\mathbb Z\). They are not one-to-one because an entire interval of real inputs shares each output. Information is lost, so neither has an inverse function from \(\mathbb Z\) back to \(\mathbb R\).
The Definitions Become Interval Tests
For an integer \(n\),
\[ \lfloor x\rfloor=n \quad\Longleftrightarrow\quad n\le x<n+1, \] \[ \lceil x\rceil=n \quad\Longleftrightarrow\quad n-1<x\le n. \]
| Function equation | Input interval | Endpoint pattern |
|---|---|---|
| \(\lfloor x\rfloor=n\) | \([n,n+1)\) | Includes \(n\), excludes \(n+1\) |
| \(\lceil x\rceil=n\) | \((n-1,n]\) | Excludes \(n-1\), includes \(n\) |
These equivalences are the main tools for solving equations and inequalities involving floor or ceiling.
Every Input Is Trapped Between Its Floor and Ceiling
The defining bounds are
\[ \lfloor x\rfloor\le x<\lfloor x\rfloor+1, \] \[ \lceil x\rceil-1<x\le\lceil x\rceil. \]
Equivalently,
\[ x-1<\lfloor x\rfloor\le x \le\lceil x\rceil<x+1. \]
Floor is a lower approximation with error less than \(1\); ceiling is an upper approximation with error less than \(1\).
The Outputs Are Equal or Adjacent
If \(x\) is an integer, then
\[ \lfloor x\rfloor=\lceil x\rceil=x. \]
If \(x\) is not an integer, then its floor and ceiling are consecutive integers:
\[ \lceil x\rceil=\lfloor x\rfloor+1. \]
Therefore,
\[ \lceil x\rceil-\lfloor x\rfloor = \begin{cases} 0,&x\in\mathbb Z,\\ 1,&x\notin\mathbb Z. \end{cases} \]
Negation Exchanges Floor and Ceiling
Reflecting the number line reverses “at or below” and “at or above.” This gives the companion identities
\[ \lceil x\rceil=-\lfloor-x\rfloor, \qquad \lfloor x\rfloor=-\lceil-x\rceil. \]
For \(x=2.3\),
\[ -\lfloor-2.3\rfloor=-(-3)=3=\lceil2.3\rceil. \]
This identity is a reliable way to derive ceiling properties from floor properties and vice versa.
Floor Separates an Integer Part from a Fractional Part
The fractional part of \(x\) is
\[ \{x\}=x-\lfloor x\rfloor. \]
It always satisfies
\[ 0\le\{x\}<1, \qquad x=\lfloor x\rfloor+\{x\}. \]
For \(x=5.8\), the fractional part is \(0.8\). For \(x=-2.3\),
\[ \{-2.3\}=-2.3-\lfloor-2.3\rfloor =-2.3-(-3)=0.7. \]
The fractional part is not \(-0.3\). It measures the nonnegative displacement from the floor to the original value. Context distinguishes the notation \(\{x\}\) from braces used for sets.
Floor and Ceiling Are Step Functions
Each function remains constant throughout an interval and jumps by \(1\) at every integer. They are therefore called step functions.
- Floor is constant on each interval \([n,n+1)\).
- Ceiling is constant on each interval \((n-1,n]\).
- Both are continuous at every noninteger input.
- Both have a jump discontinuity at every integer.
At an integer, the floor graph includes the step beginning there, while the ceiling graph includes the step ending there. In more advanced language, floor is right-continuous and ceiling is left-continuous.
Both Functions Preserve Nonstrict Order
If \(x\le y\), then
\[ \lfloor x\rfloor\le\lfloor y\rfloor, \qquad \lceil x\rceil\le\lceil y\rceil. \]
The functions are nondecreasing. They do not necessarily preserve strict inequality: \(2.1<2.9\), but both numbers have floor \(2\) and ceiling \(3\).
Integer Translation Commutes with Floor and Ceiling
For every integer \(n\),
\[ \lfloor x+n\rfloor=\lfloor x\rfloor+n, \qquad \lceil x+n\rceil=\lceil x\rceil+n. \]
Translating by a whole number shifts both the input and the selected grid point by the same amount. This rule does not generally hold when the added amount is noninteger.
Applying Either Function to an Integer Changes Nothing
Since the first application already produces an integer,
\[ \lfloor\lfloor x\rfloor\rfloor=\lfloor x\rfloor, \qquad \lceil\lceil x\rceil\rceil=\lceil x\rceil. \]
In fact, every outer floor or ceiling leaves either inner result unchanged:
\[ \lfloor\lceil x\rceil\rfloor=\lceil x\rceil, \qquad \lceil\lfloor x\rfloor\rceil=\lfloor x\rfloor. \]
A function satisfying \(F(F(x))=F(x)\) is called idempotent.
They Are Not Additive, but Their Error Is Controlled
It is generally false that \(\lfloor x+y\rfloor=\lfloor x\rfloor+\lfloor y\rfloor\). For example,
\[ \lfloor0.7+0.7\rfloor=1, \qquad \lfloor0.7\rfloor+\lfloor0.7\rfloor=0. \]
The correct two-number bounds are
\[ \lfloor x\rfloor+\lfloor y\rfloor \le\lfloor x+y\rfloor \le\lfloor x\rfloor+\lfloor y\rfloor+1, \] \[ \lceil x\rceil+\lceil y\rceil-1 \le\lceil x+y\rceil \le\lceil x\rceil+\lceil y\rceil. \]
The possible difference comes from whether the two fractional parts combine to cross an integer boundary.
Solving Floor and Ceiling Equations
Solve
\[ \lfloor2x-1\rfloor=4. \]
Replace the floor equation with its interval condition:
\[ 4\le2x-1<5. \]
Add \(1\), then divide by \(2\):
\[ 5\le2x<6, \qquad \frac52\le x<3. \]
Thus the solution set is \([5/2,3)\), an interval rather than a single number.
Useful Inequality Conversions
For an integer \(n\), the following equivalences are especially efficient:
| Original condition | Equivalent condition |
|---|---|
| \(\lfloor x\rfloor\ge n\) | \(x\ge n\) |
| \(\lfloor x\rfloor\le n\) | \(x<n+1\) |
| \(\lceil x\rceil\ge n\) | \(x>n-1\) |
| \(\lceil x\rceil\le n\) | \(x\le n\) |
The requirement that \(n\) be an integer matters. Floor and ceiling outputs cannot be arbitrary noninteger values.
Counting Integers in an Interval
The first integer in \([a,b]\) is \(\lceil a\rceil\), and the last is \(\lfloor b\rfloor\). Therefore, the number of integers in the closed interval is
\[ \max\!\left(0,\lfloor b\rfloor-\lceil a\rceil+1\right). \]
In \([2.4,7.8]\), the integers are \(3,4,5,6,7\), and the formula gives
\[ \lfloor7.8\rfloor-\lceil2.4\rceil+1 =7-3+1=5. \]
The same method scales to scheduling periods, integer solutions, grid points, page ranges, and counting multiples.
Counting Multiples by Scaling the Interval
To count multiples of a positive integer \(d\) in \([a,b]\), write each multiple as \(dk\). The condition
\[ a\le dk\le b \]
becomes
\[ \frac ad\le k\le\frac bd. \]
Therefore the count is
\[ \max\!\left( 0, \left\lfloor\frac bd\right\rfloor - \left\lceil\frac ad\right\rceil +1 \right). \]
For example, the multiples of \(6\) from \(20\) through \(50\) are \(24,30,36,42,48\): five values.
Floor Produces Quotients and Remainders
For a real number \(x\) and positive step \(d\), define
\[ q=\left\lfloor\frac xd\right\rfloor, \qquad r=x-dq. \]
Then
\[ x=dq+r, \qquad 0\le r<d. \]
For \(x=29\) and \(d=6\), \(q=4\) and \(r=5\). For \(x=-29\), floor division gives \(q=-5\) and \(r=1\):
\[ -29=6(-5)+1. \]
When \(x\) and \(d\) are integers, this is Euclidean division with a nonnegative remainder.
Capacity Problems Usually Require Ceiling
Suppose \(137\) items must be packed into boxes that hold \(24\) items each. The quotient is
\[ \frac{137}{24}\approx5.708. \]
Five boxes are insufficient, so the required count is
\[ \left\lceil\frac{137}{24}\right\rceil=6. \]
Ceiling answers “How many units are needed to cover the entire requirement?” This pattern appears in vehicles, containers, server capacity, staffing blocks, pages, rows, and time slots.
For nonnegative integers \(N\) and positive integers \(d\), an equivalent whole-number formula is
\[ \left\lceil\frac Nd\right\rceil = \left\lfloor\frac{N+d-1}{d}\right\rfloor. \]
This ceiling-division formula is useful in software because it calculates a required group count without first converting the quotient to a decimal.
Completed Groups Usually Require Floor
If \(137\) items are divided into groups of \(24\), the number of complete groups is
\[ \left\lfloor\frac{137}{24}\right\rfloor=5. \]
The remainder is
\[ 137-24(5)=17. \]
Floor answers “How many whole units are fully completed?” Ceiling and floor can therefore use the same quotient but answer different operational questions.
Floor and Ceiling Work on Any Uniform Grid
To project \(x\) onto a grid with positive spacing \(h\), scale to unit spacing, apply floor or ceiling, and scale back:
\[ L_h(x)=h\left\lfloor\frac{x}{h}\right\rfloor, \qquad U_h(x)=h\left\lceil\frac{x}{h}\right\rceil. \]
These satisfy
\[ L_h(x)\le x<L_h(x)+h, \] \[ U_h(x)-h<x\le U_h(x). \]
For quarter-hour scheduling, \(h=0.25\). A duration of \(1.62\) hours projects downward to \(1.5\) hours and upward to \(1.75\) hours.
An Offset Moves the Grid’s Reference Point
A grid need not pass through zero. With spacing \(h>0\) and reference point \(c\), its points are \(c+nh\), where \(n\in\mathbb Z\). The lower and upper projections are
\[ L_{h,c}(x) = c+h\left\lfloor\frac{x-c}{h}\right\rfloor, \] \[ U_{h,c}(x) = c+h\left\lceil\frac{x-c}{h}\right\rceil. \]
This is useful for schedules beginning at a nonzero time, bins with shifted boundaries, calibrated measurement scales, and repeating spatial layouts.
Rounding Is Related but Uses a Different Decision Rule
Floor always chooses downward and ceiling always chooses upward. Rounding to nearest chooses whichever permitted grid point is closer.
One nearest-integer convention is represented by
\[ R(x) = \left\lfloor x+\frac12\right\rfloor. \]
This formula sends exact half-integers toward \(+\infty\): \(2.5\mapsto3\) and \(-2.5\mapsto-2\). Other systems use ties-to-even, ties-away-from-zero, or another declared rule. Always state the tie convention when midpoint cases matter.
Bins, Pages, and Indices Use Step Functions
Floor assigns a continuous or large discrete input to a bin. With bin width \(h\), the index
\[ k=\left\lfloor\frac{x-c}{h}\right\rfloor \]
identifies the interval
\[ c+kh\le x<c+(k+1)h. \]
This structure appears in histograms, tax brackets, image pixels, coordinate grids, hash tables, pagination, digital sampling, and piecewise pricing.
Choose the Function from the Business Question
| Question | Typical function | Reason |
|---|---|---|
| How many complete batches were produced? | Floor | Incomplete remainder does not count as complete |
| How many containers are needed? | Ceiling | Every item must fit somewhere |
| Which interval or bin contains this value? | Floor | Bins commonly include the lower boundary |
| How many billing periods have begun? | Ceiling, under round-up billing | Any partial period triggers the next unit |
| What integer lies immediately below or above a measurement? | Floor or ceiling | The required direction determines the choice |
The formula follows the policy. Do not automatically use ceiling because a decimal appears or floor because only complete units are visible; identify what the output must guarantee.
A Reliable Floor-and-Ceiling Workflow
- Locate the input between neighboring integers.
- Identify the operational direction. Do you need a lower completed amount or an upper covering amount?
- Write the function explicitly. Use \(\lfloor\cdot\rfloor\) or \(\lceil\cdot\rceil\).
- Handle negative values by order. Mark the neighboring integers instead of deleting decimals.
- Use interval equivalences. Replace equations such as \(\lfloor u\rfloor=n\) with \(n\le u<n+1\).
- Scale the grid when needed. Divide by \(h\), project, then multiply by \(h\).
- Check the defining bounds. The floor must not exceed the input; the ceiling must not fall below it.
- Interpret the integer. Attach the correct unit: boxes, pages, groups, periods, or index values.
Common Confusions
Is floor the same as deleting the decimal part?
Only for nonnegative inputs. Deleting the decimal from \(-2.3\) gives \(-2\), but the floor is \(-3\).
Does ceiling always add \(1\)?
No. If the input is already an integer, its ceiling is unchanged: \(\lceil4\rceil=4\).
Are floor and ceiling ordinary rounding?
No. Rounding chooses a nearest value; floor always chooses at or below, and ceiling always chooses at or above.
Why is \(\lfloor-2.3\rfloor=-3\)?
Floor means the greatest integer not exceeding the input. The integer \(-2\) exceeds \(-2.3\), while \(-3\) does not.
Can a floor or ceiling output be noninteger?
No. Both functions have range \(\mathbb Z\).
Does strict order always remain strict?
No. Different inputs on the same step have the same output. The functions preserve \(\le\), not necessarily \(<\).
Is \(\lfloor x+y\rfloor=\lfloor x\rfloor+\lfloor y\rfloor\)?
Not generally. The two fractional parts may combine to cross another integer boundary.
Does \(\lfloor x\rfloor=n\) mean \(x=n\)?
No. It means \(n\le x<n+1\), so an entire half-open interval maps to \(n\).
Is the fractional part of a negative number negative?
Under the standard definition \(\{x\}=x-\lfloor x\rfloor\), it always lies in \([0,1)\).
Which function counts required containers?
Usually ceiling, because a partially filled final container still has to exist.
Which function counts complete groups?
Usually floor, because an incomplete remainder is not a complete group.
Are floor and ceiling inverse functions?
No. Each maps many real inputs to one integer output, so the original input cannot be uniquely recovered.
Working Summary
Floor selects the greatest integer at or below an input; ceiling selects the least integer at or above it. The negative-input cases follow directly from numerical order.
Their central interval descriptions are
\[ \lfloor x\rfloor=n\iff n\le x<n+1, \qquad \lceil x\rceil=n\iff n-1<x\le n. \]
These step functions connect continuous inputs to discrete outputs. They support one-sided approximation, fractional-part decomposition, quotient–remainder calculations, integer and multiple counting, scaled grids, binning, capacity planning, batching, pagination, scheduling, and later work with sequences and discontinuous functions.
Check Your Understanding
Find \(\lfloor6.92\rfloor\) and \(\lceil6.92\rceil\).
\(\lfloor6.92\rfloor=6\) and \(\lceil6.92\rceil=7\).
Find \(\lfloor-6.92\rfloor\) and \(\lceil-6.92\rceil\).
\(\lfloor-6.92\rfloor=-7\) and \(\lceil-6.92\rceil=-6\).
Find \(\lfloor-4\rfloor\) and \(\lceil-4\rceil\).
Both equal \(-4\), because the input is already an integer.
Describe all \(x\) satisfying \(\lfloor x\rfloor=-2\).
\(-2\le x<-1\), so the solution set is \([-2,-1)\).
Describe all \(x\) satisfying \(\lceil x\rceil=-2\).
\(-3<x\le-2\), so the solution set is \((-3,-2]\).
Find the fractional part of \(-7.25\).
\(\{-7.25\}=-7.25-\lfloor-7.25\rfloor=-7.25-(-8)=0.75\).
Solve \(\lfloor3x+2\rfloor=8\).
\(8\le3x+2<9\), so \(6\le3x<7\), and \(2\le x<7/3\).
How many integers lie in \([-2.6,4.2]\)?
The first is \(\lceil-2.6\rceil=-2\), and the last is \(\lfloor4.2\rfloor=4\). The count is \(4-(-2)+1=7\).
How many multiples of \(5\) lie from \(18\) through \(47\)?
The multiples are \(20,25,30,35,40,45\), so there are \(6\).
How many 12-seat vans are needed for 73 passengers?
\(\lceil73/12\rceil=\lceil6.083\ldots\rceil=7\) vans.
How many complete 12-item cartons can be filled from 73 items, and how many items remain?
\(\lfloor73/12\rfloor=6\) complete cartons, with \(73-12(6)=1\) item remaining.
Project \(5.37\) downward and upward onto the nearest hundredth grid.
Here \(h=0.01\). The number is already on that grid, so both projections equal \(5.37\).
Project \(5.376\) downward and upward onto the hundredth grid.
The lower projection is \(5.37\), and the upper projection is \(5.38\).
Evaluate \(-\lfloor-3.4\rfloor\).
\(-\lfloor-3.4\rfloor=-(-4)=4\), which also equals \(\lceil3.4\rceil\).