floor and ceiling

Rounding functions: floor rounds a number down to the nearest whole number and ceiling rounds it up.

In more detail

A heap node's parent index is floor((i - 1) / 2), written (i - 1) // 2 in Python. A B-tree's height bound uses the ceiling of a logarithm, since a partial level still counts as a level.

Related terms

Taught in

References