to apply (div) method to multi-digit divisor using a simple example,
(long [6 7 3 4] [2 2]) = [[3 0 6] [2]]
find intermediate quotients and remainders for each set of numerators
whose length is equal to the length of the denominator, unequal lengths
are ok too, but finding quotients and remainders are faster with equal
lengths.
[3 0 1] is a list of intermediate quotient, next multiply the remainder from
the first set by 10 and divide the result by the divisor, collect the
quotient in a separate list and repeat the process by using the new
remainder, as many times as the number of digits in the second set, which,
in this case, is 2.
the last remainder from this calculation is added to the remainder in the
second set, and if the result is bigger than the divisor, then the divisor
is subtracted from it and the last quotient is incremented by one.
to find the quotient, add the two quotient lists found above and normalize
the combined list so that no digit in the list is greater than 9.
3 0 1 <- intermediate quotient of dividing 67 by 22, and 34 by 22
2 2 | 6 7 3 4
1 1 2 <- intermediate remainder of dividing 67 by 22, and 34 by 22
(1 x 10) / 22 = 0 with a remainder of 10,
(10 x 10) / 22 = 4 with a remainder of 12.
the second list of quotient, [0 4], is added to the first list, [3 0 1].
[3 0 1] + [0 4] = [3 0 5].
the last remainder, 12, is added to the remainder in the second set,
12 + 12 = 24, and 24 is bigger than the divisor, so remainder is
24 - 22 = 2, and the quotient list is incremented by one,
[3 0 5] + [1] = [3 0 6].
quotient = [3 0 6], remainder = [2].
different ways of grouping may be used for more efficient calculation,
but this is the basic method.