Modular arithmetic

Loading…

All tools › Numbers

Modular arithmetic

Powers, inverses, orders and the Chinese remainder theorem

It runs entirely in this browser tab: what you type is never uploaded, and the arithmetic is exact — nothing here was ever a floating-point number.

Settings

Operation
Choices: Power, Inverse, Chinese remainder, Order of an element, Euler's totient, Discrete logarithm.
Value
The number to work with
Exponent
The power, however large; it costs nothing here
Modulus
What everything is worked out to the remainder of
Congruences
One per line: the remainder, then the modulus
Target
The value the power has to reach
Show the working
The substitution written out step by step

How to use it

  1. Paste your text into the box above, or open a file.
  2. Adjust the settings beside it until the result is what you wanted.
  3. Copy the result, or save it as a file. The result updates as you type.

Questions

Is what I type uploaded anywhere?
No. The whole application is carried as WebAssembly and runs on your own device. There is no server to send anything to, and none of these tools makes a network request while it works.
Why does it matter that there is no floating point?
Because these tools show their working. In floating point an elimination produces rows with 0.0000000000000002 where a zero belongs, and every step after it is decided by a tolerance somebody picked. In fractions the zero is a zero: the rank is a count, a determinant of a matrix of thirds is a third, and a matrix times its inverse is exactly the identity.
Can I use it in an exam or for homework?
That is between you and whoever set the work. What these give you is the method as well as the answer, which is usually what is being marked: the rule at each step, the substitution written out, the intermediate matrices, the table of values.
Why does a tool sometimes refuse instead of answering?
Because the honest answer is sometimes that there is none. An integral with no elementary antiderivative, a matrix with no inverse, a bisection over an interval with no sign change, a logarithm of zero: each is a fact rather than a failure, and a plausible number in its place would be worse than the refusal.

Other tools for numbers

Polynomials
Add, multiply, divide with a remainder, and find the roots

Trigonometry
All six functions, three units, and the exact values

Prime numbers
Every prime in a range, with the gaps, the twins and the density

Big numbers
Integers with as many digits as you type, exact to the last

All twenty-eight tools