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
From Floor is between Number and One Less:


 * $\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$