Machine Epsilon Calculator

Estimate machine epsilon for a simulated floating-point precision. This educational calculator shows the formula, result, and step-by-step interpretation.

Computer ScienceNumerical Methods

Calculator

What this calculator teaches

Machine epsilon measures spacing near 1 and helps explain floating-point roundoff.

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.

What Machine Epsilon Measures Near 1

Machine epsilon is the spacing from 1 to the next larger representable floating-point number under a common definition. For a normalized binary format with p bits of significand precision, that gap is ε=21-p. The precision count p includes the leading significand bit when the format represents it implicitly.

This value is about relative resolution near 1, not the smallest positive floating-point number. Very small magnitudes involve exponent limits and subnormal numbers, which are different properties of a format. Also note that some numerical-analysis texts use "machine epsilon" for unit roundoff, often half the spacing used here. Always check the convention.

Precision pε=21-pCommon interpretation
112-10=0.0009765625Binary16 spacing near 1
242-23≈1.19209×10-7Binary32 spacing near 1
532-52≈2.22045×10-16Binary64 spacing near 1

Floating-point spacing scales with exponent. Numbers around 2 have a larger absolute gap than numbers around 1, while the relative precision remains roughly comparable within the normalized range. That is why ε is most useful as a reference for relative rounding behavior rather than as one universal absolute error bound.

One practical experiment is to compare 1+ε with 1. Under the spacing convention used here, 1+ε is the next representable value above 1. A smaller increment may round back to 1 depending on the rounding mode, which demonstrates why tiny arithmetic changes can disappear in finite precision.

Formula & Symbols

ConceptFormula or rule
Machine epsilonε = 2^(1-p) for p precision bits

Worked example

Example: Double precision has p=53, so machine epsilon is about 2.22e-16.
Example 2: With p=24, ε=2-23≈1.1920929×10-7, the standard spacing near 1 for IEEE binary32 precision.
Example 3: With p=11, ε=2-10=0.0009765625, illustrating the much coarser spacing of a lower-precision significand.
Example 4: With p=4, ε=2-3=0.125. The next representable value above 1 in this simplified binary precision is 1.125.
Example 5: Increasing precision from p=24 to p=25 halves epsilon, because 21-25 is one-half of 21-24.

Common mistakes

⚠️
Using the wrong input format

Keep lists comma separated, matrices as rows separated by semicolons, and modular inputs as integers.

⚠️
Ignoring assumptions

Some methods require positive probabilities, valid moduli, independent trials, or small educational input sizes.

⚠️
Confusing epsilon with the smallest positive number

Epsilon describes spacing near 1. Minimum positive normal or subnormal values are controlled by the exponent range and are much smaller quantities.

⚠️
Mixing precision bits with decimal digits

The formula uses binary significand bits p. A format advertised with a certain number of decimal significant digits cannot be inserted directly as p.

FAQ

Can I use decimals?
Most numerical calculators allow decimals, but modular arithmetic and coding-theory tools usually require integers or binary strings.
Is this for homework checking?
Yes. The page is designed to show both the answer and the reasoning pattern.
Why does the result sometimes say approximate?
Some probability, floating-point, and numerical methods naturally produce approximations.
Why is binary64 epsilon 2^-52 when the precision is 53 bits?
The spacing formula is 21-p. Substituting p=53 gives 2-52. The 53-bit precision includes the leading significand bit used for normalized binary64 values.
Is machine epsilon an absolute error bound for every number?
No. It describes local spacing near 1 under the stated convention. Absolute spacing changes with the exponent, so floating-point error is usually discussed in relative terms for normalized values.
What is unit roundoff?
For rounding to nearest, unit roundoff is commonly half the gap from 1 to the next larger representable number. Some sources call that quantity machine epsilon, which is why definitions should be checked.
Does a smaller epsilon always prevent numerical error?
More precision reduces individual rounding increments, but algorithms can still amplify error through cancellation, ill-conditioning, overflow, underflow, or repeated operations. Epsilon is one component of numerical-error analysis.

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.

Measurement Uncertainty Calculator →Newton Divided Difference Calculator →Numerical Integration Comparison Calculator →Math Formula Explorer →