Definition:Rounding/Integer
Definition
Let $x \in \R$ be a real number.
Let $X \in \R$ such that:
- $X = \floor {x + \dfrac 1 2}$
Then $X$ is defined as $x$ rounded to the nearest integer.
Treatment of Half
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$.
Recall that the general philosophy of the process of rounding is to find the closest approximation to $x$ to a given power of $10$.
Thus there are two equally valid such approximations:
- $\dfrac x {10^n} - \dfrac 1 2$ and $\dfrac x {10^n} + \dfrac 1 2$
between which $\dfrac x {10^n}$ is exactly midway.
There are a number of conventions which determine which is to be used.
Examples
$72 \cdotp 8$ to Nearest Integer
$72 \cdotp 8$ rounded to the nearest integer is $73$.
This is because $72 \cdotp 8$ is closer to $73$ than it is to $72$.
Sources
- 1972: Murray R. Spiegel and R.W. Boxer: Theory and Problems of Statistics (SI ed.) ... (previous) ... (next): Chapter $1$: Rounding of Data
- 1997: Donald E. Knuth: The Art of Computer Programming: Volume 1: Fundamental Algorithms (3rd ed.) ... (previous) ... (next): $\S 1.2.4$: Integer Functions and Elementary Number Theory: Exercise $5$