The algorithm uses this relationship:

For all values of k, x/y = k/y + (x-k)/y

For example:

Code:

To divide 84732/7, let:
84732/7 = 10000 * (8/7) + 4732/7 (We lop off all but the last
= 10000 * (1 + 1/7) + 4732/7 four digits.)
= 10000 + 10000/7 + 4732/7
= 10000 + 14732/7 (At this point, we write down '1'.)
14732/7 = 1000 * (14/7) + 732/7 (We lop off all but the last
= 1000 * (2 + 0/7) + 732/7 three digits.)
= 2000 + 0/7 + 732/7
= 2000 + 732/7 (At this point, we write down '2'.)
732/7 = 100 * (7/7) + 32/7 (We lop off all but the last
= 100 * (1 + 0/7) + 32/7 two digits.)
= 100 + 0/7 + 32/7
= 100 + 32/7 (At this point, we write down '1'.)
32/7 = 10 * (3/7) + 2/7 (We lop off all but the last
= 10 * (0 + 3/7) + 2/7 one digit.)
= 0 + 30/7 + 2/7
= 0 + 32/7 (At this point, we write down '0'.)
32/7 = 1 * (32/7) + 0/7 (We lop off all the digits.)
= 1 * (4 + 4/7) + 0/7
= 4 + 4/7 + 0/7
= 4 + 4/7 (At this point, we write down '1'.)
4/7 = 0.1 * (40/7) + 0/7 (We 'lop off' past the decimal
= 0.1 * (5 + 5/7) + 0/7 place.)
= 0.5 + 0.5/7 + 0/7
= 0.5 + 0.5/7 (We write a decimal point and a
'5'.)
0.5/7 = 0.01 * (50/7) + 0/7
= 0.01 * (7 + 1/7) + 0/7
= 0.07 + 0.01/7 + 0/7
= 0.07 + 0.01/7 (We write down a '7'.)
And so on and so forth.

Substituting expressions back up, we get the answer:

Code:

10000 + 2000 + 100 + 00 + 4 + 0.5 + 0.7 + 0.01/7
= 12104.57 + 0.01/7