For an integer and positive integer , Euclidean division writes with unique integer quotient and remainder . For , repeated quotient-and-remainder steps yield the digits of a base-p expansion when . The uniqueness follows because the difference of two permitted remainders cannot be a nonzero multiple of .
For an integer and positive integer , the remainder in Euclidean division is the unique integer in for which with an integer . It is not the full quotient .
Repeated division with remainder that determines successive digits of a quotient. To generate the fractional digits in base , multiply the current remainder by , divide by the denominator, and keep the resulting remainder for the next step.