In an algorithm book once the first example was how to compute a multiplication in a loop (only that, so I just remembered, and wanted to do it programmatically but with all operations)
Multiplication was simple, say 10 * 4:
base = 0, x = 10, y = 4:
While y != 0:
base + x = 10, y--
base + x = 20, y--
base + x = 30, y--
base + x = 40, y-- (y is now 0)
Result of base: 40 (correct)
As the opposite of taking away is giving, I assumed the same was for division and multiplication (doubling, halving), but: "base - x.."
clearly does not give anything useful in an iteration..
Is this impossible? Am I looking at an algorithm to divide completely the wrong way (not like my mult)?