Least nonnegative residue
= Least nonnegative residue
{title2=$r=a\bmod m,\quad0\leq r<m$}
The least nonnegative residue of an <integer> $a$ modulo a positive <integer modulus> $m$ is the unique representative $r$ of its <congruence class> in $\{0,\ldots,m-1\}$. <Euclidean division> gives $a=qm+r$. For example, $-3=(-1)\cdot5+2$, so $-3\bmod5=2$; the <integer congruence> $-3\equiv2\pmod5$ does not assert equality of those two <integers>.