How to show that if $[x]=v$ then :
$$\left|x-v\right|\le\frac{1}{2}$$
Where $ []$ is the nearest Integer Function.
I know how to round a real number,but how to prove this?it looks simple,however I could not prove that.
How to show that if $[x]=v$ then :
$$\left|x-v\right|\le\frac{1}{2}$$
Where $ []$ is the nearest Integer Function.
I know how to round a real number,but how to prove this?it looks simple,however I could not prove that.
If by contradiction we would have $\lvert x - v \rvert > \frac{1}{2}$ that would mean that either $x > v + \frac{1}{2}$ or $x < v - \frac{1}{2}$. In the first case the $v + 1$ would be a better approximation of $x$ and in the second it would be $v - 1$ as we would have $\lvert x - (v + 1) \rvert < \frac{1}{2}$ in the first case and $\lvert x - (v - 1) \rvert < \frac{1}{2}$ in the second one.