Modulo calculator
Modular operation is different from remainder operation. "Mod" is the transliteration of "Mod", and modular operation is mostly used in programming. Mod means remainder. Modular operation is widely used in number theory and programming, from the determination of odd and even numbers to the determination of prime numbers, from modular power operation to the method of finding the greatest common divisor, from the Sun Tzu problem to the Caesar cipher problem, all of which are full of modular operation. Although many number theory textbooks have a certain introduction to modular operation, most of them are based on pure theory, and the application of modular operation in programming is not involved much.
For example, 11 Mod 2, the value is 1
The above modular operation is mostly used in programming. Let's take an example to illustrate the principle of modular operation:
Turbo Pascal's explanation of mod is as follows:
A Mod B=A-(A div B) * B (div means integer division)