Short Answer
In any technical discipline, rounding is a necessary evil. But when you round a number, then round that result again, you may introduce an error that changes the final answer—this is the double rounding error. It is a subtle but critical pitfall in measurement, engineering, and scientific computation. This article explains the phenomenon, demonstrates it with concrete examples, and provides authoritative guidance from international standards.
Rule Statement
The double rounding error occurs when a value is rounded to an intermediate precision, and then that rounded value is rounded again to the final precision. The final result may differ from what you would obtain by rounding the original value directly to the final precision. The fundamental rule is: never round intermediate results; round only the final answer. This principle is embedded in major standards for measurement and data processing.
Mathematically, if x is the true value, Rn is rounding to n significant digits, then Rm(Rn(x)) is not necessarily equal to Rm(x) when n > m. The error arises because the first rounding discards information that could affect the second rounding.
Worked Examples
Example 1: Significant Figures
Consider x = 1.2345, and we want to round to 3 significant figures.
- Direct rounding: Look at the 4th digit (4), which is less than 5, so round down: 1.23.
- Double rounding: First round to 4 significant figures: 1.235 (since the 5th digit is 5, round up). Then round 1.235 to 3 significant figures: look at the 4th digit (5), which is ≥5, so round up: 1.24.
The direct result is 1.23, but the double-rounded result is 1.24—a difference of 0.01, which may be significant in engineering tolerances.
Example 2: Decimal Places
Take x = 2.675, round to 2 decimal places.
- Direct: The third decimal is 5, so half-up rounding gives 2.68.
- Double: Round to 3 decimals first: 2.675 (already 3 decimals), then to 2 decimals: 2.68 (same). Here no error, but the error depends on the value and the rounding mode.
Counter-Examples
Not all values exhibit the error, but many do. Here are counter-examples that highlight the danger:
- 0.445 to 2 significant figures: Direct: 0.45 (since third digit 5 rounds up). Double: round to 3 sig figs (0.445) then to 2 sig figs: 0.45 (same).
- 1.005 to 3 significant figures: Direct: 1.01 (fourth digit 5 rounds up). Double: round to 4 sig figs (1.005) then to 3 sig figs: 1.01 (same).
- 9.995 to 3 significant figures: Direct: 10.0 (fourth digit 5 rounds up, carry over). Double: round to 4 sig figs (9.995) then to 3 sig figs: 10.0 (same).
These examples show that the error is not universal, but when it occurs, it can be large relative to the precision. The risk is highest when the discarded digit is exactly 5 or when the value is near a rounding boundary.
Convention Comparison Table
Different rounding conventions affect the double rounding error. The table below compares common methods.
| Convention | Rule for digit = 5 | Effect on Double Rounding |
|---|---|---|
| Half-up (round half away from zero) | Round up | Error possible; example 1.2345 → 1.24 vs 1.23 |
| Half-down (round half toward zero) | Round down | Error possible; often opposite direction |
| Banker’s rounding (round half to even) | Round to nearest even digit | Reduces error but does not eliminate it |
| Truncation (round toward zero) | Always truncate | Error can still occur if intermediate truncation discards a digit that would cause a carry |
Regardless of convention, the only safe practice is to round once, at the end of the calculation.
Standards Citation
Several international standards explicitly address rounding and the prohibition of intermediate rounding.
- ASTM E29 – Standard Practice for Using Significant Digits in Test Data to Determine Conformance with Specifications: Section 6.1 states that “the value shall be rounded directly to the required number of significant digits” and warns against “rounding to more digits than are to be retained, then rounding again.”
- ISO 80000-1 – Quantities and units, Part 1: General: Clause 7.3.4 recommends that “rounding should be performed on the final result, not on intermediate values.”
- NIST Technical Note 1297 – Guidelines for Evaluating and Expressing the Uncertainty of NIST Measurement Results: Appendix A discusses rounding of uncertainty and states that “rounding should be done only at the final step.”
- JCGM 100:2008 (GUM) – Evaluation of measurement data — Guide to the expression of uncertainty in measurement: Section 7.2.6 advises that “the numerical values of the input estimates and their standard uncertainties should not be rounded before the calculation of the output estimate.”
These standards are unambiguous: avoid intermediate rounding.
Common Mistakes
- Rounding after each arithmetic operation – e.g., rounding the sum of two measurements before adding the next.
- Using a calculator that displays rounded values – many calculators show fewer digits than they store; if you manually copy the displayed value, you are double rounding.
- Applying significant figure rules to constants and exact numbers – exact numbers (like counting numbers) have infinite significant figures; they should not be rounded.
- Rounding in a multi-step calculation and then using the rounded value as input to a function – e.g., computing ln(x) after rounding x.
- Assuming that more decimal places always mean more accuracy – the precision of the result is limited by the least precise measurement, not by the number of displayed digits.
Practice Problems
Test your understanding. For each problem, compute the direct rounding to 3 significant figures and the double rounding via 4 significant figures, then compare.
- x = 2.3456
- x = 0.007845
- x = 123.45
- x = 9.9999
Answers: (1) Direct 2.35, double 2.35 (no error). (2) Direct 0.00784, double 0.00784 (no error). (3) Direct 123, double 123 (error? 123.45 direct to 3 sig figs: 123 (since fourth digit 4), double: 123.5 then to 123? Actually 123.5 to 3 sig figs is 124? Wait 123.5 has 4 sig figs, to 3 sig figs: 124 (since fourth digit 5 rounds up) – so error: direct 123 vs double 124). (4) Direct 10.0, double 10.0 (no error).
Software Behavior Note
Many software tools and programming languages have built-in rounding functions that may inadvertently cause double rounding if used carelessly. For example:
- Excel and Google Sheets – the ROUND function rounds to a specified number of digits. If you nest ROUND functions, you are double rounding. Always use a single ROUND at the end.
- Python – the built-in
round()uses banker’s rounding. If you callround(round(x, 4), 3), you are double rounding. - JavaScript – floating-point representation can cause unexpected rounding errors; avoid intermediate rounding and use toFixed() only on the final output.
- MATLAB – the
roundfunction rounds half away from zero by default. Useround(x, n, 'significant')for significant digits, but still round only once.
In all cases, the safest approach is to carry full precision through all calculations and apply rounding only when displaying or reporting the final result.
Quick Reference Table
| Scenario | Correct Action |
|---|---|
| Multi-step calculation | Keep all digits until the final step, then round. |
| Reporting a measured value | Round to the precision of the uncertainty (usually 1 or 2 significant digits of uncertainty). |
| Comparing to a specification limit | Round the measured value to the same number of significant digits as the limit, but do not round before comparison if the limit is exact. |
| Using a calculator | Use the internal full precision; do not manually copy intermediate displayed values. |
| Programming | Apply rounding only at the output stage; use format specifiers (e.g., printf in C) that round the final value. |
FAQ
Why does double rounding happen?
Double rounding happens because the first rounding discards information that could influence the second rounding. For example, if a digit is exactly 5, the first rounding may push the value over a threshold, changing the result of the second rounding.
Is double rounding always wrong?
Not always—sometimes the result is the same. But you cannot know without checking. Standards universally recommend rounding once to avoid any risk.
How do I avoid double rounding in my work?
Keep full precision in all intermediate steps. Only round the final reported value. If you must use a rounded value for further calculations, treat it as an approximation and be aware of the potential error.
Leave a Reply