Textbook
The ceiling of a real number $x$, written $\lceil x\rceil$, is the least integer no smaller than $x$. If $k=\lceil x\rceil$, then $k-1<x\le k$. For integer $x$, the identity is $\lceil x\rceil=x$: rounding does not add one unnecessarily.
Thus $\lceil2.7\rceil=3$ and $\lceil-2.7\rceil=-2$. For positive integers $n,c$, storing $n$ records on pages of capacity $c$ takes $\lceil n/c\rceil$ pages. A partly filled last group still needs its own page. If division is exact, no extra page is required.
The defining inequality establishes minimality: $k$ is already at least $x$, but the previous integer $k-1$ is too small. Hence $0\le\lceil x\rceil-x<1$. For an integer input, rounding error is zero; otherwise it is positive. With negative numbers, moving upward still means choosing a larger number, so β2 qualifies for β2.7 even though its absolute value is smaller.
Definitions and further reading: Mathematics for Computer Science.
In plain language
The ceiling resembles the number of whole containers needed for belongings: a requirement of 2.75 containers needs three. An exact requirement of two needs no third, and an empty requirement needs none. The rule selects the nearest integer at or above the input without adding an automatic service surcharge. Containers model nonnegative quantities; for negative inputs, the number line determines the direction rather than the packaging returns desk.
Example
The example places the original 11 records on pages of capacity 4. Two pages hold eight; the remaining three need one more. The result 3 satisfies $2<11/4\le3$.
The Ceiling Function: Rounding Up
First page
Four records are placed; seven remain.
Step 1 of 3: First page
Read all steps
First page
Four records are placed; seven remain.
- State
- 1β4included5β11current
Second page
Eight records are placed; three still need space.
- State
- 1β4included5β8included9β11current
Third page
The partly filled last page brings the total to three.
- State
- 1β4included5β8included9β11included
Three pages provide 12 spaces, leaving one unused. That spare space does not make the answer excessive: two pages provide only 8 spaces and fail the capacity requirement. This checks both sides of the definition, sufficiency of three and insufficiency of the previous integer. Exactly eight records would leave no partial group, so the same principle would require only two pages without an extra charge.
Related concepts: Floor, Remainders.