Calculation methodology

Published

Fraction operations use arbitrary-precision integers (BigInt) in your browser. This page summarizes the calculation rules so you can check a result yourself.

Exact fractions

Every fraction is normalized: the denominator stays positive, and the numerator and denominator are divided by their greatest common divisor. For example, 18/24 is shown as 3/4. Zero has a single form, 0/1. A zero denominator or a division by zero produces an error, not a result.

Inputs and limits

The main calculator accepts signed integers, fractions, terminating decimals, repeating decimals written in parentheses, and mixed numbers. The engine’s limits are:

An input outside those limits is rejected with a message; it is never shortened or rounded silently. Specialized tools state their own limits next to their fields.

Rounding and decimals

The reduced fraction is the exact result. To show it as a decimal, the engine follows these rules:

A rounded decimal is not a substitute for the fraction if you are going to keep calculating with the result.

Order of operations

Expressions are evaluated in this order:

  1. Parentheses and brackets.
  2. Powers with an integer exponent. They group from right to left, and −2^2 equals −4 because the power is computed before the sign.
  3. Multiplication and division, left to right. A number next to a parenthesis, as in 2(3 + 4), is multiplied.
  4. Addition and subtraction, left to right.

If the expression contains the ÷ sign, the fraction bar / groups before × and ÷, so 1/2 ÷ 3/4 reads as (1/2) ÷ (3/4). For examples with parentheses, see expressions with fractions.

Negative mixed numbers

The sign of a mixed number applies to the whole quantity: −2 1/3 equals −7/3, not −2 + 1/3. The fractional part of a mixed number must be proper: “2 4/3” is rejected.

How the engine is tested

Automated tests compare every operation with a separate cross-multiplication calculation, using integers of up to twelve digits. They also check that the reduced form is unique, that addition is commutative and associative, that subtracting and adding back returns the starting value, and that the sign of a mixed number applies to the whole-number part. Each property runs with a fixed seed and, by default, 1,000 cases. The 100-digit limit is tested too.

The numeric examples on the pages can be repeated in the calculator. If a result does not match, tell us on the corrections page.

Next step

Fraction calculator Add, subtract, multiply or divide fractions, mixed numbers and decimals, or type a calculation with parentheses.
Report an errorHow we handle corrections

Use the fraction calculator

YOUR CALCULATOR, CLOSE AT HAND

Save your calculator

Open your browser menu and choose “Install app” or “Add to Home Screen”. You can also bookmark this page.