Calculatorism

Modulo Calculator

Compute the remainder of a ÷ n (a mod n) and the quotient.

Input Data

A
N

Results

Remainder.
2
Integer quotient floor(a/n).
3
Explanatory note about the result.
17 = 3·5 + 2(餘數 2)

At a glance:a mod n = a − n·floor(a/n); the remainder has the same sign convention as the implementation. Complements gcd-lcm and division.

Formula

a = n·q + r, where r = a mod n.

How to Use

  1. Enter a and n.
  2. The tool returns the remainder and quotient.

Case Studies

17 mod 5

remainder 2, quotient 3.

FAQ

Modulo of negative a?

Convention varies; this uses the floor-based remainder.

Related Tools

References

Content review: Calculatorism Science Team. Results are for reference only; please refer to the relevant authorities for the official figures.

Found a problem with the results?

If this calculator's result is wrong, or you have any question about the calculation logic, please let us know. You are viewing:Modulo Calculator(/math/modulo)。