Modular Arithmetic Calculator
Perform modular arithmetic operations including addition, multiplication, exponentiation, and modular inverse calculations.
Select an operation and enter the values to perform modular arithmetic.
結果
値を入力して計算をクリックして結果を表示してください。
Theory & Formula
Modular Arithmetic Theory
Modular arithmetic is a system of arithmetic for integers where numbers "wrap around" upon reaching a certain value (the modulus). We write a ≡ b (mod m) to mean that a and b have the same remainder when divided by m.
Basic Operations
Addition: \((a + b) \bmod m\)
Multiplication: \((a \times b) \bmod m\)
Exponentiation: \(a^b \bmod m\)
Modular Inverse: \(a \times a^{-1} \equiv 1 \pmod{m}\)
Applications
Modular arithmetic is fundamental in cryptography (RSA, Diffie-Hellman), computer science (hash functions, checksums), and number theory. The modular inverse is used extensively in cryptographic algorithms.
Example
17 + 8 ≡ 0 (mod 5) because 25 mod 5 = 0. Also, 3^(-1) ≡ 2 (mod 5) because 3 × 2 = 6 ≡ 1 (mod 5).