Modular Arithmetic (Remainder Arithmetic)
Suppose x is a nonnegative integer and m is a positive integer
(called the modulus).
Then x mod m denotes the remainder of x when divided by
m.
In Scheme: (remainder x m)
If r = x mod m, then
- r is in the set {0, 1, ..., m-1}, and
- there is an integer q such that:
x = qm + r