Calculator
Example data
These examples demonstrate how different precision choices affect error size.
| Exact value | Rounding target | Precision | Rule | Rounded value | Absolute error | Percent error |
|---|---|---|---|---|---|---|
| 12.34567 | Decimal places | 2 | Half up | 12.35 | 0.00433 | 0.03507% |
| 0.009876 | Significant figures | 3 | Half even | 0.00988 | 0.000004 | 0.04050% |
| -1250.49 | Decimal places | 0 | Toward zero | -1250 | 0.49 | 0.03919% |
Formula used
- Rounded value: \( \tilde{x} = \mathrm{round}(x) \) according to the selected rule and precision.
- Signed round-off error: \( e = \tilde{x} - x \)
- Absolute error: \( |e| = |\tilde{x} - x| \)
- Relative error: \( r = \frac{|e|}{|x|} \) (if \(x \neq 0\))
- Percent error: \( 100 \times r \)
- Step size (ULP): \( s = 10^{-d} \) for d decimal places, or \( s = 10^{\lfloor\log_{10}|x|\rfloor - p + 1} \) for p significant figures.
- Typical bound: half-rounding gives \( |e| \le s/2 \); truncation/floor/ceiling give \( |e| < s \).
How to use this calculator
- Enter the exact value you want to round.
- Select decimal places or significant figures.
- Pick a rounding rule (half up, half even, truncation, floor, ceiling).
- Set the precision and choose an output format if needed.
- Click Calculate to view rounded value and errors.
- Use Download CSV or Download PDF to export your report.
FAQs
1) What is round-off error?
Round-off error is the difference between an exact value and its rounded version. It can be reported as signed error, absolute error, relative error, or percent error, depending on how you want to measure the impact.
2) What’s the difference between absolute and relative error?
Absolute error is the size of the rounding difference in the same units as the number. Relative error scales that difference by the exact magnitude, making it easier to compare errors across very small and very large values.
3) When should I use significant figures instead of decimals?
Use significant figures when the meaningful precision is about digits, not decimal position. This is common in measurements and scientific data where values can span many orders of magnitude and a fixed decimal count would misrepresent precision.
4) What is half-even rounding?
Half-even rounds ties to the nearest even last digit. It reduces bias in repeated calculations, which is why it is used in some financial and statistical contexts. Non-tie cases behave like usual rounding to the nearest value.
5) Why can truncation have a different bound?
Truncation drops digits toward zero rather than rounding to the nearest value. The error is always smaller than one full step size, but it can be close to that step. Unlike half-rounding, the error is not centered around zero.
6) What does “rounding step” mean?
The rounding step is the gap between adjacent representable rounded results at your chosen precision. For 2 decimal places it is 0.01. For significant figures it depends on magnitude, such as 10 for three significant figures near 12,345.
7) What if the exact value is zero?
Relative and percent error divide by the exact magnitude, so they are undefined when the exact value is zero. The calculator will still report the rounded value and absolute error, which remain meaningful in that special case.
8) How accurate are the results for very large numbers?
The calculator uses floating-point arithmetic. For extremely large or highly precise inputs, tiny rounding details may be limited by floating-point representation. If you need strict decimal arithmetic, consider using arbitrary-precision math for critical applications.