Modular arithmetics is an arithmetic system for integers. We will learn how various arithmetical operators work with modulus in the below sections.
1. Modular Addition and Subtraction:
(A+B) mod C = (A mod C + B mod C) mod C
(A-B) mod C = ( A mod C - B mod C ) mod C
2. Modilar Multiplication:
(A* B) mod C = (A mod C * B mod C) mod C
3. Modular Exponentiation
AB mod C = ((A mod C)B) mod C