Definition:Rounding/Treatment of Half/Round to Even

Definition
Let $n \in \Z$ be an integer.

Let $x \in \R$ be a real number.

Consider the situation when $\dfrac x {10^n} + \dfrac 1 2$ is an integer.

That is, $\dfrac x {10^n}$ is exactly midway between the two integers $\dfrac x {10^n} - \dfrac 1 2$ and $\dfrac x {10^n} + \dfrac 1 2$.

The round to even convention is that the nearest even integer to $\dfrac x {10^n}$ is used:


 * $y = \begin {cases} 10^n \floor {\dfrac x {10^n} + \dfrac 1 2} & : \text {$\floor {\dfrac x {10^n} + \dfrac 1 2}$ even} \\ 10^n \ceiling {\dfrac x {10^n} - \dfrac 1 2} & : \text {$\floor {\dfrac x {10^n} + \dfrac 1 2}$ odd} \end {cases}$

where $y$ is the rounded value.

This convention has the advantage over the rounding up and rounding down in that it minimizes cumulative rounding errors.