SoupCalc

Long Division Calculator with Quotient and Remainder

Long Division Calculator: enter values and calculate the result.

Use this tool to enter the required values, run the calculation, and compare the key results immediately.

What this tool calculates

This calculator divides a dividend a by a nonzero divisor b and reports three views: an integer quotient truncated toward zero, the corresponding remainder, and the ordinary decimal quotient. Showing all three makes the sign convention visible instead of hiding it behind a single decimal.

The implementation follows JavaScript's truncation and remainder behavior. That convention agrees with familiar positive-integer long division but differs from floor-division conventions for some negative inputs.

Inputs

Enter a finite dividend and a finite, nonzero divisor. The interface accepts signs and decimals, although “long division” with integer quotient and remainder is clearest when both are integers. A divisor of zero is rejected.

If a textbook, programming language, accounting rule, or modular-arithmetic system specifies floor division or a non-negative remainder, compare its convention before using this output. The same dividend and divisor can have different quotient/remainder pairs under different definitions while preserving the division identity.

Method and formula

For dividend a and divisor b:

quotient = trunc(a ÷ b)

remainder = a mod b under the runtime's remainder operator

decimal = a ÷ b

The reported values satisfy a = b × quotient + remainder subject to floating-point behavior. Truncation moves toward zero: trunc(−3.4) is −3, not −4. The remainder therefore has the dividend's sign when it is nonzero in this convention.

Worked example

Enter dividend -17 and divisor 5.

  • Decimal result: -17 ÷ 5 = -3.4.
  • Truncated quotient: -3.
  • Remainder: -17 − (5 × -3) = -2.

The identity check is 5 × (-3) + (-2) = -17. The calculator therefore displays quotient -3, remainder -2, and decimal -3.4. With floor division, a system might instead use quotient -4 and remainder 3; that is a different convention, not the one implemented here.

How to interpret the result

For positive whole numbers, the quotient counts complete groups and the remainder is what is left. For signed values, interpret the pair algebraically and name the truncation convention. The decimal output provides the exact division view to the available floating-point precision.

Use the identity check whenever a signed remainder seems surprising. In software work, test the target language because % is not defined identically across all languages and mathematical texts.

Accuracy and limitations

The calculator uses floating-point numbers rather than arbitrary-precision integers. Very large integers may not be represented exactly, and remainders with decimal inputs can show binary-rounding artifacts. Display formatting can also hide additional digits.

Zero division is undefined and rejected. The page does not show handwritten subtraction steps, repeating-decimal notation, Euclidean non-negative remainders, polynomial division, unit conversion, or uncertainty. For cryptography or exact large-integer arithmetic, use a big-integer implementation with a documented modulus definition.

Sources

Editorial record

Author: SoupCalc Editorial Team

Last reviewed: August 14, 2026

Review scope: Toward-zero quotient semantics, signed remainder identity, zero-divisor rejection, floating-point limits, references, and the −17 divided by 5 example were checked.