Floor of Negative equals Negative of Ceiling
From ProofWiki
Contents |
Theorem
Let $x \in \R$ be a real number.
Let $\left \lfloor {x}\right \rfloor$ be the floor of $x$, and $\left \lceil {x}\right \rceil$ be the ceiling of $x$.
Then:
- $\left \lfloor {-x}\right \rfloor = - \left \lceil {x}\right \rceil$
Proof
From Range of Values of Floor Function we have:
- $x - 1 < \left \lfloor{x}\right \rfloor \le x$
and so:
- $-x + 1 > -\left \lfloor{x}\right \rfloor \ge -x$
From Range of Values of Ceiling Function we have:
- $\left \lceil{x}\right \rceil = n \iff x \le n < x + 1$
And so $-x \le -\left \lfloor{x}\right \rfloor < -x + 1 \implies -\left \lfloor{x}\right \rfloor = \left \lceil{-x}\right \rceil$.
$\blacksquare$
Also see
Sources
- Donald E. Knuth: The Art of Computer Programming: Volume 1: Fundamental Algorithms (1968): $\S 1.2.4$: Exercise $4$