Modular arithmetic, sometimes also called clock arithmetic, is a way of doing arithmetic with integers. Much like hours on a clock, which repeat every twelve hours, once the numbers reach a certain value, called the modulus, they go back to zero.
In general, given a modulus , we can do addition, subtraction and multiplication on the set in a way that "wrap around" . This set is sometimes represented by the symbol , and called the set of integers modulo .[1][2][3]
People talked about modular arithmetic in many ancient cultures. For instance, the Chinese remainder theorem is many centuries old. The modern notation and exact definition of modular arithmetic were first described by Carl Friedrich Gauss.[4]