Enter signed integers
Type any integers for the
dividend a and divisor b.
Find the exact remainder. Check the signed division.
Type any integers for the
dividend a and divisor b.
The tool computes the remainder r
and quotient q with 0 ≤ r < |b|.
Verify that a = b × q + r and
that 0 ≤ r < |b|.
The comparison uses a different quotient convention; it is not a contradictory result.
The Euclidean convention chooses a remainder between zero and 5, with 5 excluded. The quotient is −4 because −17 = 5 × (−4) + 3.
Yes. The remainder remains in 0 ≤ r < |b|. For −17 and −5, q = 4 and r = 3.
Languages can choose different quotient and remainder conventions. JavaScript % uses truncation toward zero, giving −17 % 5 = −2. This calculator explicitly uses a nonnegative Euclidean remainder.