Order of Floor Function

Theorem
Let $\floor x$ denote the floor function of $x$.

Then:


 * $\floor x = x + \map {\mathcal O} 1$

where $\mathcal O$ is Big-O notation.

Proof
By the definition of the floor function, we have:


 * $\floor x \le x < \floor x + 1$

so:


 * $0 \le x - \floor x < 1$

By the definition of the absolute value function, we have:


 * $\size {\floor x - x} < 1$

so:


 * $\floor x - x = \map {\mathcal O} 1$

then:


 * $\floor x = x + \map {\mathcal O} 1$