next up previous
Next: Logarithms Up: CSE 2320: Algorithms and Previous: Monotonicity

Floors and Ceilings

floor(x), denoted $\lfloor x \rfloor$, is the greatest integer $\leq$ x.

ceiling(x), denoted $\lceil x \rceil$, is the smallest integer $\geq$ x.


Normally used to divide input into integral parts.

Note: $\lceil n/2 \rceil + \lfloor n/2 \rfloor = n$

Copyright © 1998 The University of Texas at Arlington