Question:
Find a formula for the integer with smallest absolute value that is congruent to an integer $a \bmod m$, where $m$ is a positive integer.
My attempt:
I don't completely understand the question, I reckon, "smallest absolute value that is congruent to integer $a \bmod m$ is the Canonical representation of $a \bmod m$, such that the smallest absolute value $x$ is
$0 \leq x < m$
which is equal to $a \bmod m$.
Books answer:
The following is the answer I do not understand and request for explaination why:
$x \bmod m$ if $x \bmod m \leq \lceil m/2 \rceil$ and $(x \bmod m) - m$ if $x \bmod m > \lceil m/2 \rceil$