4 ms·
Not OP, but I'm guessing he means this: 52/13: 52 - 13 = 39 39 - 13 = 26 26 - 13 = 13 13 - 13 = 0 count the subtractions and you get 4. As long as we're
by redblacktree 13y ago
Not OP, but I'm guessing he means this:
52/13:
52 - 13 = 39
39 - 13 = 26
26 - 13 = 13
13 - 13 = 0
count the subtractions and you get 4.
As long as we're sticking to integer division, this works out fairly well. Here, a calculation with a remainder:
54/13:
54 - 13 = 41
41 - 13 = 28
28 - 13 = 15
15 - 13 = 2 (smaller than 13, so this is our remainder)
54/13 = 4 with 2 reaminder