Modular Arithmetic Calculator

Welcome to the Modular Arithmetic Calculator, which performs arithmetic modulo an integer m (called the modulus).

To use the calculator, enter a non-zero integer for the modulus m, and integers a and b below. Then press one of the operation buttons.

If you enter very large numbers—having 17 digits, for example—the calculator may return incorrect results. This is due to the inherent limitations of the way computers do arithmetic, using floating-point numbers. If you need to work very large numbers, try the Big Integer Modular Arithmetic Calculator (Big MAC), which uses the Perl bigint module to handle large integers.

    m =
     a =
     b =


Please send any comments or suggestions for improving the Modular Arithmetic Calculator.

   Paul Trow's math page.

Copyright 2009 by Paul Trow