y=xy = \lceil x \rceil

Graph of the Ceiling Function y=xy = \lceil x \rceil

y=xy = \lceil x \rceil is the ceiling function, which returns the smallest integer greater than or equal to xx. The bracket symbol  \lceil\ \rceil suggests a ceiling and forms a pair with the floor function x\lfloor x \rfloor (the greatest integer at most xx).

Some concrete values:

  • 2=2\lceil 2 \rceil = 2
  • 2.1=3\lceil 2.1 \rceil = 3
  • 2.9=3\lceil 2.9 \rceil = 3
  • 1.2=1\lceil -1.2 \rceil = -1

Integers are left unchanged, while any non-integer is pushed up to the next integer. Note that for a negative number this rounds toward zero (to the right on the number line).

Domain and range. The domain is all real numbers and the range is the set of all integers. The graph is a staircase of horizontal segments at integer heights. Each step has width 11: on the interval (n1, n](n-1,\ n] the value is exactly nn. So every step includes its right end (the integer point, a filled dot) and excludes its left end (an open dot).

Discontinuities and jumps. The function is discontinuous at every integer. At an integer nn the left-hand limit equals nn and so does the value, so it is continuous from the left; but just past nn the value leaps to n+1n+1. Every jump has size +1+1, and the ceiling function is left-continuous, in contrast with the right-continuous floor function.

Relation to other functions. Ceiling and floor are linked by a reflection through the sign:

x=x\lceil x \rceil = -\lfloor -x \rfloor

Moreover, when xx is not an integer, x=x+1\lceil x \rceil = \lfloor x \rfloor + 1, and when xx is an integer the two agree.

Applications. Rounding up appears everywhere in daily life and in computing. The number of boxes needed to pack nn items at kk per box is n/k\lceil n/k \rceil; page counts, the number of buses required, and memory block counts are all computed with the ceiling.