Modular arithmetic

maths
Modular arithmetic

Given two values $a,b \in \mathbb{Z}$ (though this can be expanded to other domains). We define $a$ modulo $b$ to be the remainder when dividing $a$ by $b$. Write

$$a = b \cdot m + r, \mbox{ with } m,r \in \mathbb{z}, \mbox{ and } 0 \leq r < b.$$

Then $a \equiv_b r$ or equally $a = r$ (mod $b$).

Theory

Mod a given integer is an equivalence relation on $\mathbb{Z}$ and the concept expands more generally to other domains.