modulo returns the remaining number of a division. for example: 20 % 8 = 4.
step1: 20 / 8 = 2
step2: 2 * 8 = 16
step3: 20 - 16 = 4
the algorithm is basically: A - (B * Floor(A / B)). Floor() rounds down a number. so instead of 20 / 8 = 2.5, it rounds it down to 2.0. hope its clear now. ![]()