Modulo Operation/Examples/5 mod 3

Theorem

 * $5 \bmod 3 = 2$

where $\bmod$ denotes the modulo operation.

Proof
By definition of modulo operation:
 * $x \bmod y := x - y \floor {\dfrac x y}$

for $y \ne 0$.

We have:
 * $\dfrac 5 3 = 1 + \dfrac 2 3$

and so:
 * $\floor {\dfrac 5 3} = 1$

Thus:
 * $5 \bmod 3 = 5 - 3 \times \floor {\dfrac 5 3} = 5 - 3 \times 1 = 2$