Euclidean division
= Euclidean division
{c}
{title2=$a=bq+r,\quad0\le r<b$}
{wiki}
For an <integer> $a$ and positive <integer> $b$, Euclidean division writes $a=bq+r$ with unique integer quotient $q$ and remainder $0\le r<b$. For $a\ge0$, repeated quotient-and-remainder steps yield the digits of a <base-p expansion> when $b=p$. The uniqueness follows because the difference of two permitted remainders cannot be a nonzero multiple of $b$.