In mathematics and computing, the method of complements is a technique used to subtract one number from another using only addition of positive numbers. This method was commonly used in mechanical calculators and is still used in modern computers.
Definition of congruence relation
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 example,
because 38 − 14 = 24, which is a multiple of 12, or, equivalently, because both 38 and 14 have the same remainder 2 when divided by 12.