Division and Remainder Calculator

Divide any numbers and get precise quotient and remainder with options. Supports negatives, decimals, Euclidean remainder, and detailed step logic for tough cases. Batch examples included with fast CSV and PDF exports for recordkeeping needs. Clean white layout, perfect for classrooms and pros everywhere.

Input

Tip Euclidean remainder is always non-negative and strictly less than |b|.

Result

Enter values and press Calculate to see the result here.

Example Data

Use these examples to understand sign conventions and Euclidean vs truncated remainders.

Dividend (a) Divisor (b) Euclidean (q, r) Truncated (q, r)
-135(-3, 2)(-2, -3)
206(3, 2)(3, 2)
7-3(-2, 1)(-2, 1)
12310(12, 3)(12, 3)

Comparison: Euclidean vs Truncated (More Samples)

Additional pairs showing how remainders differ with signs and decimals.

a b qeuclid reuclid qtrunc rtrunc a/b (exact, 4dp)
-254-73-6-1-6.2500
25-4-61-61-6.2500
-25-4736-16.2500
10.5331.531.53.5000
-10.53-41.5-3-1.5-3.5000
7.2-2.5-22.2-22.2-2.8800

Language Modulo Behavior (Quick Reference)

Typical defaults; always verify specific versions and flags for your environment.

Language Division rule for % Remainder sign when b > 0 Example: -13 % 5
PHP Truncates toward zero Same as dividend (may be negative) -3
JavaScript Truncates toward zero Same as dividend (may be negative) -3
Java Truncates toward zero Same as dividend (may be negative) -3
C / C++ Typically truncates toward zero Same as dividend (may be negative) -3
Python Floor division pair (// and % linked) Always non‑negative if b > 0 2

Note: Many languages define a = bq + r, but choose different q (truncated vs floored). That choice determines the sign of r.

Formulas Used

  • Truncated Division: q = (int)(a / b), r = a − b × q.
  • Euclidean Division: find integers q and r such that a = bq + r and 0 ≤ r < |b|.
  • Relationship: The two conventions match when a / b ≥ 0 or when r_trunc ≥ 0.
  • Exact Quotient: a / b, rounded to your selected decimal places.

How to Use

  1. Enter Dividend (a) and Divisor (b). Avoid b = 0.
  2. Choose decimal places for the displayed exact quotient.
  3. Select the remainder convention you prefer to highlight in results.
  4. Tick Show steps for a concise derivation.
  5. Press Calculate. Export the results to CSV or PDF.

FAQs

It is the unique remainder r satisfying a = bq + r with 0 ≤ r < |b|, regardless of signs of a or b.

Truncated remainder uses q = (int)(a/b) which truncates toward zero, so the remainder can be negative when a/b is negative.

Use Euclidean for number theory or modular arithmetic. Use truncated to mirror many programming languages’ % operator behavior.

Yes. The exact quotient field shows the decimal result rounded to your selected precision. Remainder logic still follows the same definitions.

You may be comparing Euclidean vs truncated conventions. Ensure you’re using the same remainder definition as your reference.

Related Calculators

Proportion and Ratio Calculatorsquare root calculator with stepsnegative square root calculatorfraction square root calculatorsquare root division calculatordecimal to square root calculatorderivative of square root calculatorharmonic mean calculatorbinomial distribution mean calculatordiscrete random variable mean calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.