Floating-Point Error Calculator
Compare exact, approximate, absolute, relative, and percentage floating-point error. This educational calculator shows the formula, result, and step-by-step interpretation.
Calculator
What this calculator teaches
Floating-point error calculations help explain rounding limits in computers and numerical methods.
Use the result as a learning aid. For classwork, still show the formula and intermediate reasoning so the final answer is not just a black-box number.
Absolute, Relative, and Percentage Error
Error measures how far an approximation lies from a reference value, but different error measures answer different questions. Absolute error |xapprox − xexact| keeps the same units as the quantity. Relative error divides that distance by |xexact|, making the error dimensionless and allowing comparisons across different scales. Percentage error is the relative error multiplied by 100%.
A small absolute error can still be large relative to a tiny exact value. For example, an error of 0.0001 is negligible compared with 100 but is 5% of 0.002. Conversely, a numerically larger absolute error can be relatively small when the reference value is large. This scale dependence is why numerical analysis often reports both absolute and relative error.
| Measure | Formula | Interpretation |
|---|---|---|
| Absolute error | |xa − xe| | Distance from the reference in original units |
| Relative error | absolute error / |xe| | Error compared with reference magnitude |
| Percentage error | 100 × relative error | Relative error expressed as a percent |
When the exact value is zero, the usual relative-error formula divides by zero and is undefined. Absolute error remains meaningful in that case. Floating-point computations can also contain representation and rounding effects, so a tiny nonzero difference between mathematically equivalent decimal expressions is often expected.
Formula & Symbols
| Concept | Formula or rule |
|---|---|
| Absolute error | |approx - exact| |
| Relative error | absolute error / |exact| |
Worked example
Common mistakes
Keep lists comma separated, matrices as rows separated by semicolons, and modular inputs as integers.
Some methods require positive probabilities, valid moduli, independent trials, or small educational input sizes.
Error magnitude is normally reported with an absolute value. A signed difference can be useful as a bias or residual, but it is not the same quantity as absolute error.
The standard true relative error uses the magnitude of the reference or exact value in the denominator. Using the approximation defines a different measure.
FAQ
Related calculators
These links will work after the calculators are registered in the final Math layout update.
Formula Explorer connections
Interpretation: This relationship converts, summarizes or checks numerical quantities using standard arithmetic and measurement rules. Assumption: Use consistent units, preserve enough significant digits, and round only the final result unless the method states otherwise.