How this calculation works
A calendar or repeating cycle often needs a nonnegative remainder. Truncating −17/5 toward zero instead gives −3 and a negative remainder.
a = bq + r, where q = floor(a/b) and 0 ≤ r < bA worked example
−17 = 5 × (−4) + 3, so the quotient is −4 and the remainder is 3.
Good to know
The divisor is positive. Some languages use a quotient truncated toward zero.
Reference: OpenStax Prealgebra (opens in a new tab) ↗
Read the result
Find the Euclidean quotient and nonnegative remainder, including for a negative dividend.
The primary result is labeled “Floor quotient”. Keep the input definitions in view when comparing this result with another method.
Try a related calculation
The divisor is positive. Some languages use a quotient truncated toward zero.
For a related exercise, try the fraction calculator.
A few questions, answered
How can I check the default inputs by hand?
−17 = 5 × (−4) + 3, so the quotient is −4 and the remainder is 3.
Which rule does this calculator apply?
a = bq + r, where q = floor(a/b) and 0 ≤ r < b