Math Fundamentals18 sections · 814 units
Open in Course

Properties of Modulo

Addition and multiplication

Modulo has special properties that make calculations easier:

∙\bullet (a+b) mod m=((a mod m)+(b mod m)) mod m(a + b) \bmod m = ((a \bmod m) + (b \bmod m)) \bmod m

∙\bullet (a×b) mod m=((a mod m)×(b mod m)) mod m(a \times b) \bmod m = ((a \bmod m) \times (b \bmod m)) \bmod m

These let you take modulo at each step instead of waiting until the end. This prevents overflow when working with large numbers.