next up previous
Next: Up: Previous:

Division Theorem

For any integer a and positive integer n, there are unique integers q and r such that 0 $\leq$ r < n and a = qn + r

*
q (= $\lfloor$a/n$\rfloor$) is the quotient of the division
*
r (= a mod n) is the remainder
*
a = $\lfloor$a/n$\rfloor$n + (a mod n) or
a mod n = a - $\lfloor$a/n$\rfloor$n
*
If (a mod n) = (b mod n), then a $\equiv$ b (mod n)

Example

22 mod 5 = 2
-13 mod 5 = 2


next up previous
Next: Up: Previous: