Skip to main content

Discrete Mathematical Structures

Subsection 2.3.3 Floor and Ceiling

Definition 2.3.3.1.

The floor of a real number \(x\text{,}\) denoted \(\floor{x}\text{,}\) is the largest integer that is less than or equal to \(x\text{.}\)

Example 2.3.3.2. Floor.

The floor \(\floor{2.7} = 2\text{,}\) since \(2\) is the largest integer that is less than or equal to \(2.7\text{.}\)

Warning 2.3.3.3.

Computing the floor of a real number is different from just throwing away everything after the decimal. In the next example, we compute the floor of a negative number.

Example 2.3.3.4. Floor of a negative number.

The floor \(\floor{-2.7} = -3\text{,}\) since \(-3\) is the largest integer that is less than or equal to \(-2.7\text{.}\)

Example 2.3.3.5. Floor of an integer.

The floor of an integer is the integer itself, so \(\floor{3} = 3\text{,}\) \(\floor{-3} = -3\text{,}\) and \(\floor{0} = 0\text{.}\)

Definition 2.3.3.6.

The ceiling of a real number \(x\text{,}\) denoted \(\ceiling{x}\) , is the smallest integer that is greater than or equal to \(x\text{.}\)

Example 2.3.3.7. Ceiling.

The ceiling \(\ceiling{2.7} = 3\text{,}\) since \(3\) is the smallest integer that is greater than or equal to \(2.7\text{.}\)

Warning 2.3.3.8.

Computing the ceiling of a real number is different from just throwing away everything after the decimal and adding \(1\text{.}\) In the next example, we compute the ceiling of a negative number.

Example 2.3.3.9. Ceiling of a negative number.

The ceiling \(\ceiling{-2.7} = -2\text{,}\) since \(-2\) is the smallest integer that is greater than or equal to \(-2.7\text{.}\)

Example 2.3.3.10. Ceiling of an integer.

The ceiling of an integer is the integer itself, so \(\ceiling{3} = 3\text{,}\) \(\ceiling{-3} = -3\text{,}\) and \(\ceiling{0} = 0\text{.}\)

Remark 2.3.3.11.

If we think of \(x\) as a point on the usual real number line, then the floor of \(x\) is the integer that is directly to the left of \(x\text{,}\) unless \(x\) itself is an integer. The ceiling of \(x\) is the integer that is directly to the right of \(x\text{,}\) unless \(x\) itself is an integer.