Tolerance.tolerance

Tolerance.tolerance(truevalue, rtol, atol)[source]

Compute the tolerance for a comparison.

Parameters:
truevaluefloat

The true value of the comparison.

rtolfloat

The relative tolerance.

atolfloat

The absolute tolerance.

Returns:
float

The tolerance.

Examples

>>> tol = Tolerance()
>>> tol.tolerance(1.0, 0.001, 1e-06)
0.001001
>>> tol.tolerance(10.0, 0.001, 1e-06)
0.010001
>>> tol.tolerance(10.0, 0.001, 1e-08)
0.01000001