Ceiling Function and Floor Function
Definition 1
The Ceiling function $\lceil \cdot \rceil : \mathbb{R} \to \mathbb{Z}$ and the Floor function $\lfloor \cdot \rfloor : \mathbb{R} \to \mathbb{Z}$ are defined as follows. $$ \lceil x \rceil := \min \left\{ n \in \mathbb{Z} : x \le n \right\} \\ \lfloor x \rfloor := \max \left\{ n \in \mathbb{Z} : n \le x \right\} $$
Description
In domestic terms, the Floor function $\lfloor \cdot \rfloor$ is also widely known as the Gauss function $[ \cdot ]$. Since it corresponds to rounding down the digits in the decimal system, it is intuitive, and therefore, it is common to use the Floor function rather than the Ceiling function.
In analytic number theory, it is also used in defining identities for the Dirichlet product.
Code
In most programming languages that are strong in scientific computing, the Ceiling function is implemented as ceil()
, and the Floor function as floor()
. In TeX, while it’s common to use \left
and \right
for left and right distinctions, uniquely, ceiling and floor are used as follows.
Left | Right | |
---|---|---|
Ceiling | \lceil | \rceil |
Floor | \lfloor | \rfloor |