11-29-2022, 06:24 AM
Another simple explanation for you @bplus:
Think of what MOD is... It's the remainder after division... nothing more, nothing less.
INT(27 / 5) = 5
5 * 5 = 25
27 - 25 = 2
2 is the remainder.
INT(27 / -5) = -5
-5 * -5 = 25
27 - 25 = 2
2 is the remainder.
INT(-27 / 5) = -6
5 * -6 = -30
-27 - -30 = 3
3 is the answer.
It's that simple.
Think of what MOD is... It's the remainder after division... nothing more, nothing less.
INT(27 / 5) = 5
5 * 5 = 25
27 - 25 = 2
2 is the remainder.
INT(27 / -5) = -5
-5 * -5 = 25
27 - 25 = 2
2 is the remainder.
INT(-27 / 5) = -6
5 * -6 = -30
-27 - -30 = 3
3 is the answer.
It's that simple.