I have two arrays (dividend, divisor):
dividend[] = {1,2,0,9,8,7,5,6,6};
divisor[] = {9,8};
I need the result (dividend/divisor) as:
<
Do long division.
Have a temporary storage of size equal to the divisor plus one, and initialized to zero:
accumulator[] = {0,0,0};
Now run a loop:
accumulator / divisor
and set the least-significant place of the quotient to the result. Set the accumulator to the remainder.Used to use this same algorithm a lot in assembly language for CPUs what didn't have division instructions.