Math Fundamentals18 sections · 814 units
Open in Course

Vocabulary - Ceiling

Rounding up

The ceiling function x\lceil x \rceil rounds xx up to the nearest integer. For example, 7.1=8\lceil 7.1 \rceil = 8 and 2.9=2\lceil -2.9 \rceil = -2 (up means toward positive infinity).

You use ceiling when you need to know how many groups are required to hold all items. If you have 77 items and each group holds 33, you need 7/3=3\lceil 7 / 3 \rceil = 3 groups.

A trick: a/b=(a+b1)/b\lceil a / b \rceil = \lfloor (a + b - 1) / b \rfloor when aa and bb are positive integers. This avoids floating-point division.