Modulo

Updated: 10/17/2017 by Computer Hope
Modulo animation

Modulo is a math operation that finds the remainder when one integer is divided by another. In writing, it is frequently abbreviated as mod, or represented by the symbol %.

For two integers a and b:

a mod b = r

Where a is the dividend, b is the divisor (or modulus), and r is the remainder.

Examples

11 mod 4 = 3, because 11 divides by 4 (twice), with 3 remaining.

25 mod 5 = 0, because 25 divides by 5 (five times), with 0 remaining.

3 mod 2 = 1, because 3 divides by 2 (once), with 1 remaining.

5 mod 2 = 1, because all odd numbers give a remainder of 1 when divided by 2.

Modular arithmetic and cryptography

Modular arithmetic is the field of mathematics which concerns these types of operations, in which values "wrap around" (reset to zero) when they reach a modulus value. Modular arithmetic is extremely important in the field of cryptography, which encodes information using modulo operations that have a very large modulus.

Computer abbreviations, Cryptography, Mod, Programming terms