Modulo Operation/Examples/100 mod 7

From ProofWiki
Jump to navigation Jump to search

Theorem

$100 \bmod 7 = 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 {100} 7 = 14 + \dfrac 2 7$

and so:

$\floor {\dfrac {100} 7} = 14$


Thus:

\(\ds 100 \bmod 7\) \(=\) \(\ds 100 - 7 \times \floor {\dfrac {100} 7}\)
\(\ds \) \(=\) \(\ds 100 - 7 \times 14\)
\(\ds \) \(=\) \(\ds 2\)

$\blacksquare$


Sources