Long Division and Decimal Calculator

Exact decimal arithmetic, long division with its steps, and remainders by a stated rule

Ordinary calculators compute 0.1 + 0.2 and quietly hand back a number with a tail of nines or a stray four, because binary floating point cannot hold most decimals exactly. This page does decimal arithmetic exactly, digit for digit, the way long arithmetic works on paper: additions, subtractions and multiplications are exact at any length, and division is shown as long division, step by step, with the quotient’s decimal places generated one at a time and any repeating cycle detected and written in the proper notation, 0.(142857). An integer-division mode returns quotient and remainder under one stated convention (floor division, verified by a = b × q + r in the results), because “the remainder” of a negative division is two different answers until somebody names the rule.

Disclaimer: This calculator gives estimates for general information only. It is not financial, medical or other professional advice. Division steps are shown up to the stated cap; repeating cycles are detected exactly, however long they run.

What this calculator does

The numbers you type are held as exact decimals (a sign, a string of digits and a scale), and the arithmetic is integer arithmetic on those digits: nothing is ever converted through binary floating point, so 0.1 + 0.2 is 0.3, in full, as a matter of construction rather than luck. Division deserves its own machinery: the page runs the school long-division algorithm on the exact ratio, producing digits until the decimal terminates, a remainder repeats (which proves the digit cycle repeats, and the cycle is bracketed), or the step cap is reached and honestly reported. Integer division follows the floor convention used by mathematics and most programming languages, where the remainder carries the divisor’s sign, and every answer is verified in the open: b × q + r must rebuild a exactly, and the results line shows that it does.

How to use it

  • Type the numbers as text. Long decimals keep every digit: a 20-digit input is computed with, not rounded on entry, which is the entire point of an exact tool.
  • Places are where division rounds. The exact or repeating form is printed first; the rounded form at your requested places follows it (half-up rounding), so the rounding is a choice displayed, never a silent edit.
  • Repeating notation reads as a loop. 0.(142857) means 0.142857142857… forever; a terminating decimal has no brackets, and a cycle longer than the display shows in the steps is still detected and counted.
  • Integer division is for sharing problems. Quotient (how many whole times) and remainder (what is left) answer the questions decimals cannot: boxes packed, seats filled, items per page, and the verification line is the share-out checked.

The method

  • Exact representation: each operand is parsed to sign × integer digits × 10^(−scale). Addition and subtraction align scales and add integers; multiplication multiplies digits and adds scales. Trailing zeroes are trimmed for display, exactness kept.
  • Division: the ratio of the two scaled integers is reduced to a whole-number long division: integer part first, then each decimal digit from remainder × 10. A remainder map (remainder seen at step k) detects the cycle: when a remainder recurs, the digits since its first appearance form the repetend. Termination when a remainder reaches zero.
  • Integer division (floor convention): q = floor(a / b), r = a − b × q, so r has the sign of b (or is zero) and 0 ≤ |r| < |b|; printed with the verification a = b × q + r expanded in numbers.
  • Rounding for display at the requested places is half-up on the exact digit stream, never on a floating-point approximation of it.

Worked examples

22 ÷ 7. Integer part 3, remainder 1; then the long division runs 10 → 1 rem 3, 30 → 4 rem 2, 20 → 2 rem 6, 60 → 8 rem 4, 40 → 5 rem 5, 50 → 7 rem 1, and the remainder 1 has appeared before: the cycle (142857) repeats forever, so 22/7 = 3.(142857), and at 6 places, 3.142857. The remainder’s recurrence IS the proof of repetition, which is why the steps are printed rather than summarised.

The exactness test: 0.1 + 0.2. On this page it is 0.3, exactly, because the digits were added as digits. On a binary floating-point device it is 0.30000000000000004, the most famous rounding artifact in computing; both machines are doing their jobs, but only one of them is doing decimal arithmetic, and questions about money and measurement are decimal questions.

Integer division: −7 ÷ 2. Floor convention: q = −4, r = 1, verified: 2 × (−4) + 1 = −7. (The truncation convention would say q = −3, r = −1; the page names its rule on the result so the two can never be confused silently.)

Reading your results

Read the bracketed cycle as the exact value and the rounded line as its usable shadow: 3.(142857) is what 22/7 IS, 3.142857 is what you write down, and the difference is not error but notation. In integer division, read the verification before the answer: any claimed q and r that fail to rebuild a are wrong under every convention, and the floor rule then fixes which of the passing pairs this page means. When a division’s steps stop at the cap with no cycle yet, the result says so: some ratios (like 1/97) have cycles 96 digits long, and detection, not display length, is the guarantee.

Limitations

  • Steps are capped for the screen. The cycle detection runs exactly regardless, but the printed step list stops at 40 steps (stated on the result when it binds), since a 96-step list helps no one’s reading.
  • Inputs must be finite decimals. Fractions like 1/3 belong in their exact form on the Fraction Calculator; entering 0.333333 here computes with the digits given, honestly and only those.
  • Floor is a convention, declared. School sharing problems often expect truncation toward zero for negatives; the page prints its convention and verification so a teacher’s rule and this one can be told apart at a glance.
  • Roots, powers and percentages live elsewhere. This page is the four operations done exactly; the scientific, exponent and percentage calculators handle their own domains and link back by the hub.

Frequently asked questions

Why does my calculator say 0.1 + 0.2 = 0.30000000000000004?

Because it computes in binary: a tenth has no finite binary expansion, so 0.1 and 0.2 are both stored as slight overestimates, and their sum’s error peeks out in the last digits. It is not a bug and it is not sloppiness; it is the wrong number system for decimal questions. This page stores decimals as decimal digits and adds integers, so the artifact cannot occur: the example is kept in the worked examples precisely because it is the quickest test of which arithmetic a calculator is really doing.

How can you tell a decimal repeats without dividing forever?

By watching the remainders: each long-division step’s digit depends only on the current remainder, and the remainder is always one of finitely many values (0 up to the divisor minus 1), so within a bounded number of steps either a remainder hits zero (the decimal terminates) or one repeats, and from that moment the digits must cycle identically forever. The steps printed on this page are that argument made visible: find the recurring remainder and you have found the cycle’s start and length with certainty.

What is the difference between quotient and remainder answers?

The decimal answer to 17 ÷ 5 is 3.4, a single number locating the result on the number line; the integer-division answer, q = 3 and r = 2, describes a distribution: three whole fives handed out, two left over. Both are exact; they answer different questions. Negative values force a convention (this page: floor, remainder takes the divisor’s sign), and the verification a = b × q + r printed with every result is what makes any convention checkable rather than a matter of trust.

How do you write a repeating decimal?

With the cycle bracketed in parentheses (or, in handwriting, a bar over the cycle): 0.(142857) for 1/7’s tail, 3.(142857) for 22/7, and mixed cases like 0.1(6) for 1/6, where a non-repeating head precedes the cycle. This page generates the notation from the remainder record, head and cycle separated at exactly the step where the remainder first recurred, which is the only honest way to place the bracket.

Related calculators

Method: exact scaled-integer decimal arithmetic for addition, subtraction and multiplication; long division with remainder-mapped cycle detection for division; floor-convention integer division verified by a = b × q + r. Last reviewed: 15 October 2026.