In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" upon reaching a certain value—the modulus (plural moduli). The modern approach to modular arithmetic was developed by Carl Friedrich Gauss in his book "Disquisitiones Arithmeticae", published in 1801. 

A familiar use of modular arithmetic is in the 12-hour clock, in which the day is divided into two 12-hour periods. If the time is 7:00 now, then 8 hours later it will be 3:00. Usual addition would suggest that the later time should be , but this is not the answer because clock time "wraps around" every 12 hours. Because the hour number starts over after it reaches 12, this is arithmetic "modulo" 12. According to the definition below, 12 is congruent not only to 12 itself, but also to 0, so the time called "12:00" could also be called "0:00", since 12 is congruent to 0 modulo 12. 

Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers that is compatible with the operations on integers: addition, subtraction, and multiplication. For a positive integer , two numbers and are said to be ", if their difference is an integer multiple of (that is, if there is an integer such that ). This congruence relation is typically considered when and are integers, and is denoted (some authors use instead of ; in this case, if the parentheses are omitted, this generally means that "mod" denotes the modulo operation, that is, that ).
how is the day divided?
 divided into two 12-hour periods