Measurement and Units

How Rounding Too Early Can Spoil a Result

See with checked numbers how early rounding magnifies errors in differences, powers and long chains, and how to prevent it.

Key takeaways

  • Keep at least two or three extra digits in intermediate values and round once at the end.
  • Subtracting nearly equal numbers can turn a tiny rounding error into a huge relative error.
  • Powers and long chains of repeated steps multiply or accumulate small discrepancies.
  • Rounding the final answer is still necessary, because extra digits there would claim knowledge you do not have.

Rounding in the middle of a calculation injects a small error that later steps can magnify. The safe habit is to carry extra digits through every intermediate step and round only when you write the final answer, to a precision that matches how well the inputs are known.

Most of the time an early rounding costs little. In a few common situations it can ruin a result completely, and the final number gives no warning. Knowing those situations is the point of this article.

A first example with a third

Compute one third of 3,000. Done in one step, the answer is 1,000. Now round the third first:

1 ÷ 3 ≈ 0.33
0.33 × 3,000 = 990

The error is 10, or 1 percent. The rounding changed 0.3333... by about 1 percent, and multiplication passed that percentage straight through. Keeping 0.333333 would have made the error negligible.

Multiplication and division are forgiving in this sense: the relative error stays about the same size. Other operations are less kind.

The big hazard: subtracting close numbers

Find √1001 − √1000. With plenty of digits:

√1001 = 31.638584...
√1000 = 31.622777...
difference ≈ 0.015807

Now round each square root to four significant figures first:

31.64 − 31.62 = 0.02
error ≈ (0.02 − 0.015807) ÷ 0.015807 ≈ 27%

Each input was good to better than 0.01 percent, and the answer is 27 percent too large. The leading digits canceled, leaving only the digits that rounding had damaged. This effect is often called catastrophic cancellation.

You can sometimes rewrite the formula to avoid it. Multiplying and dividing by the sum of the roots gives an identical expression with no subtraction of close values:

√1001 − √1000 = 1 ÷ (√1001 + √1000)

using the rounded roots:
1 ÷ (31.64 + 31.62) = 1 ÷ 63.26 ≈ 0.015808

Now four-figure inputs give an excellent answer.

Powers stretch errors

Raising a number to a power multiplies its relative error by roughly the exponent. Take a sphere with radius 2.46 cm and volume (4/3)πr³.

Radius used r³ Volume
2.46 cm 14.887 62.36 cm³
2.5 cm 15.625 65.45 cm³

Rounding the radius changed it by about 1.6 percent and the volume by about 5 percent, roughly three times as much.

High powers are more dramatic. Suppose something grows by a factor of 1.0425 in each of 30 periods.

1.0425³⁰ ≈ 3.49
1.04³⁰   ≈ 3.24

Shortening the factor by less than a quarter of a percent changed the final value by about 7 percent. Exponential and trigonometric functions near steep regions behave similarly.

Long chains and one-sided errors

When many rounded values are added, random-looking rounding errors partly cancel. If every error leans the same way, they pile up.

Add the value 0.4 one hundred times. The true total is 40. Round each term to a whole number first and every one becomes 0, so the total is 0. The case is contrived, but any set of items that falls consistently on one side of a rounding boundary behaves this way.

Chopping off digits, called truncation, is always one-sided for positive numbers. In the early 1980s the Vancouver Stock Exchange index was recalculated many times a day with its value truncated each time. Over about two years it sank to roughly half of what it should have shown, until the calculation was corrected.

Where early rounding bites
Close differences Leading digits cancel High powers Relative error multiplies Long chains One-sided errors accumulate Repeat rounding Two steps can differ from one Close differences Leading digits cancel High powers Relative error multiplies Long chains One-sided errors accumulate Repeat rounding Two steps can differ from one

A lab example: variance by shortcut

A classic trap hides in the calculation of a standard deviation. One textbook shortcut subtracts the square of the mean from the mean of the squares. Take three readings: 100.1, 100.2 and 100.3.

mean = 100.2

direct method:
deviations  −0.1, 0, 0.1
mean of squared deviations = 0.02 ÷ 3 ≈ 0.00667

shortcut:
mean of squares = (10020.01 + 10040.04 + 10060.09) ÷ 3 ≈ 10040.0467
square of mean  = 100.2² = 10040.04
difference      ≈ 0.0067

With all digits kept, the two agree. Now suppose you round each square to five significant figures: 10020, 10040 and 10060. Their mean is 10040, and subtracting 10040.04 gives a negative number, about −0.04. A variance can never be negative, so here the error announces itself. In other data sets it produces a positive but wrong value that nobody questions.

The direct method works with the small deviations from the start and is far more robust. (These formulas divide by the number of readings; the sample version divides by one less, and the rounding problem is the same.)

Rounding twice

Rounding in stages can give a different answer from rounding once. Take 2.4496 and suppose you want two significant figures.

directly to two figures:     2.4496 → 2.4
first to three figures:      2.4496 → 2.45
then to two figures:         2.45   → 2.5   (rounding halves upward)

The direct answer is correct, because 2.4496 is closer to 2.4 than to 2.5. Whenever you round, start from the most complete value you have. This matters when numbers copied from a report, already rounded, are rounded again.

For exact halves there is also a convention called round half to even: 2.5 goes to 2 and 3.5 goes to 4. Over many values, this avoids the slight upward lean of always rounding halves up. Rules differ between fields and software, so say which you used when it matters.

What computers do

Calculators and spreadsheets carry many digits, but not infinitely many. Most computers store decimal fractions in binary, where 0.1 has no exact finite form. That is why a program may report that 0.1 + 0.2 equals 0.30000000000000004.

A few habits help.

  • Do not test two computed decimal values for exact equality. Check that they differ by less than a sensible tolerance.
  • Remember that a cell's displayed format is not the stored value. A column shown to two decimals may add to a total that seems off by a cent.
  • Watch for functions that truly round or truncate the stored value, and use them only where intended.
  • For money, use whatever exact decimal type and legal rounding rule the task requires.

Formula and copying errors are a related risk, discussed in spreadsheet errors in research.

How many digits to carry and to report

The final precision should reflect the uncertainty, as described in reporting measurement uncertainty. During the work, keep more.

  1. Keep the full calculator value in memory when you can.
  2. If copying by hand, keep at least two guard digits beyond the precision you expect to report.
  3. Keep extra digits in constants such as π, so that they never limit the result.
  4. Compute the uncertainty alongside the value, using the rules for combining uncertainties.
  5. Round the uncertainty to one or two significant figures.
  6. Round the value to the same decimal place.

Say a calculation yields 9.810638 with an uncertainty of 0.099834. Report 9.8 ± 0.1. If you were going to use the value again, pass on 9.8106 and not 9.8.

Significant figure rules and their limits

School rules for significant figures give a quick guide: for products, keep as many figures as the least precise input, and for sums, as many decimal places. They are rules for the final answer. Applied after every step, they cause exactly the damage shown above.

They are also crude. Two inputs with three significant figures can have very different relative precision: 1.01 is known to about 1 percent by its last digit, while 9.89 is known to about 0.1 percent. When the result matters, work out the uncertainty properly.

Unit conversions and chained factors

Conversions invite early rounding because each factor looks small and harmless. Say you convert 55 miles per hour to meters per second. A mile is exactly 1,609.344 meters.

careful:  55 × 1,609.344 ÷ 3,600 ≈ 24.59 m/s
rough:    1 mile ≈ 1.6 km, and 1 ÷ 3.6 ≈ 0.28
          55 × 1.6 × 0.28 ≈ 24.64 m/s

The rough path is off by about 0.2 percent, fine for conversation and poor for a calibration. The two rounding errors here happen to lean in opposite directions and partly cancel, which is luck and cannot be relied upon.

Exact definitions deserve to stay exact. Write the whole conversion as one expression, cancel the units on paper and evaluate it once. This also exposes an upside-down factor before it does harm.

Converting back and forth is a good test. If a value converted to another unit, rounded and converted back no longer matches the original within its uncertainty, too many digits were thrown away. Tables that list the same quantity in two units are a common place for this, particularly when one column was computed from the rounded figures in the other.

Percentages that fail to add

Rounded shares often total 99 or 101 percent. Three equal thirds shown as whole percentages give 33 + 33 + 33 = 99. Nothing is wrong with the data. Add a short note, and resist the urge to nudge one value, which would make that entry disagree with its own source.

The reverse operation is more risky. Recovering a count from a rounded percentage can give the wrong whole number, especially for large totals: 33 percent of 12,000 is 3,960, while one third is 4,000. When you need to compute further, go back to the original counts.

How to catch the problem

  • Recalculate with one more digit everywhere. If the answer shifts noticeably, you were rounding too hard.
  • Look for subtractions where the two values share several leading digits.
  • Estimate the size of the answer independently and compare.
  • Keep a record of unrounded intermediate values so that someone else can retrace the path.
  • Change the order of steps. Different orders should agree closely in a well-behaved calculation.

If a difference of close measured values is the quantity you care about, consider changing the experiment. Measuring that difference directly protects both against rounding and against the underlying uncertainty of the two larger readings.

Written for 4Sciences with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 51 articles in Measurement and Units →

Latest news on this topic