Skip to content

Floor and Ceiling Functions

Definition

For a real number xx, the floor of xx is the largest integer less than or equal to xx, and the ceiling of xx is the smallest integer greater than or equal to xx:

⌊x⌋=max⁡{n∈Z ⁣:n≤x},⌈x⌉=min⁡{n∈Z ⁣:n≥x}.\begin{aligned} \lfloor x\rfloor&=\max\{n\in\mathbb{Z}\colon n\le x\},\\ \lceil x\rceil&=\min\{n\in\mathbb{Z}\colon n\ge x\}. \end{aligned}

Equivalently, for an integer nn, ⌊x⌋=n\lfloor x\rfloor=n exactly when n≤x<n+1n\le x<n+1, and ⌈x⌉=n\lceil x\rceil=n exactly when n−1<x≤nn-1<x\le n. Both are functions from R\mathbb{R} to Z\mathbb{Z}.


Interpretation

The floor rounds down and the ceiling rounds up to the nearest integer. On the number line, ⌊x⌋\lfloor x\rfloor is the integer at or immediately to the left of xx and ⌈x⌉\lceil x\rceil the integer at or immediately to the right.

"Down" means towards −∞-\infty, not towards 00. The name integer part usually means ⌊x⌋\lfloor x\rfloor, but for negative numbers some texts instead mean truncation towards zero, which differs: ⌊−2.5⌋=−3\lfloor-2.5\rfloor=-3, while truncation gives −2-2. For the same reason ⌊−x⌋\lfloor-x\rfloor is not −⌊x⌋-\lfloor x\rfloor unless xx is an integer.

The graphs are staircases. On each interval [n,n+1)[n,n+1) the floor is constant, so it is continuous at every non-integer; at each integer it jumps up by 11. 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.

Step graphs of the floor (solid blue) and ceiling (dashed red) from x = −3 to x = 3 around the line y = x, with open and closed endpoints and the vertical line x = 2.7.

The floor (solid blue) has its filled dots at the left ends of the steps; the ceiling (dashed red) is constant on each (n−1,n](n-1,n] and has its filled dots at the right ends, so it is left-continuous instead. At an integer nn both take the value nn. The thin grey line y=xy=x runs between the two staircases, which is the inequality ⌊x⌋≤x≤⌈x⌉\lfloor x\rfloor\le x\le\lceil x\rceil, and the vertical line at x=2.7x=2.7 meets the floor at 22 and the ceiling at 33, as in the first example.

Move xx, or type an integer: the floor and ceiling are the integers on either side of xx and coincide only when xx is an integer. For negative xx, compare the floor with truncation towards 00. The last view shows the fractional part x−⌊x⌋x-\lfloor x\rfloor, which has period 11.


Key Results

  • For every x∈Rx\in\mathbb{R}, x−1<⌊x⌋≤x≤⌈x⌉<x+1x-1<\lfloor x\rfloor\le x\le\lceil x\rceil<x+1, and the two non-strict inequalities are equalities exactly when xx is an integer.
  • ⌈x⌉−⌊x⌋\lceil x\rceil-\lfloor x\rfloor is 00 if xx is an integer and 11 otherwise.
  • ⌈x⌉=−⌊−x⌋\lceil x\rceil=-\lfloor-x\rfloor, and ⌊x+n⌋=⌊x⌋+n\lfloor x+n\rfloor=\lfloor x\rfloor+n for every integer nn. In general the floor is not additive: ⌊x⌋+⌊y⌋≤⌊x+y⌋≤⌊x⌋+⌊y⌋+1\lfloor x\rfloor+\lfloor y\rfloor\le\lfloor x+y\rfloor\le\lfloor x\rfloor+\lfloor y\rfloor+1.
  • Both functions are nondecreasing step functions that jump by 11 at each integer. At an integer nn, lim⁡x→n−⌊x⌋=n−1\lim_{x\to n^-}\lfloor x\rfloor=n-1 and lim⁡x→n+⌊x⌋=n=⌊n⌋\lim_{x\to n^+}\lfloor x\rfloor=n=\lfloor n\rfloor, 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 x−1<⌊x⌋≤xx-1<\lfloor x\rfloor\le x and the squeeze theorem, ⌊x⌋/x→1\lfloor x\rfloor/x\to1 as x→∞x\to\infty.
  • For x≥0x\ge0, ⌊x⌋\lfloor x\rfloor counts the positive integers in [1,x][1,x].
  • The fractional part x−⌊x⌋x-\lfloor x\rfloor lies in [0,1)[0,1) and is periodic with period 11.

Examples

  • ⌊2.7⌋=2\lfloor2.7\rfloor=2, ⌈2.7⌉=3\lceil2.7\rceil=3, ⌊−2.7⌋=−3\lfloor-2.7\rfloor=-3, ⌈−2.7⌉=−2\lceil-2.7\rceil=-2 and ⌊5⌋=⌈5⌉=5\lfloor5\rfloor=\lceil5\rceil=5.
  • At x=1x=1, ⌊x⌋=0\lfloor x\rfloor=0 for 0≤x<10\le x<1 but ⌊1⌋=1\lfloor1\rfloor=1, so the left-hand one-sided limit is 0≠⌊1⌋0\neq\lfloor1\rfloor while the right-hand limit is 11.
  • Additivity fails: ⌊0.5⌋+⌊0.5⌋=0\lfloor0.5\rfloor+\lfloor0.5\rfloor=0, but ⌊0.5+0.5⌋=1\lfloor0.5+0.5\rfloor=1.
  • The number of multiples of 33 in {1,2,…,100}\{1,2,\ldots,100\} is ⌊100/3⌋=33\lfloor100/3\rfloor=33.
  • In branch-and-bound, a fractional LP value xj=1.25x_j=1.25 is excluded by the two branches xj≤⌊1.25⌋=1x_j\le\lfloor1.25\rfloor=1 and xj≥⌈1.25⌉=2x_j\ge\lceil1.25\rceil=2.
  • In life insurance, the curtate future lifetime is Kx=⌊Tx⌋K_x=\lfloor T_x\rfloor, the number of complete future years: a future lifetime Tx=23.6T_x=23.6 gives Kx=23K_x=23, and Kx=kK_x=k exactly when k≤Tx<k+1k\le T_x<k+1.

Prerequisites

Sources

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