cfdm.atol

cfdm.atol(*atol)[source]

The tolerance on absolute differences when testing for numerically tolerant equality.

Two real numbers x and y are considered equal if abs(x-y) <= atol + rtol*abs(y), where atol (the tolerance on absolute differences) and rtol (the tolerance on relative differences) are positive, typically very small numbers. By default both are set to the system epsilon (the difference between 1 and the least value greater than 1 that is representable as a float).

New in version (cfdm): 1.7.0

See also

rtol

Parameters
atol: float, optional

The new value of absolute tolerance. The default is to not change the current value.

Returns
float

The value prior to the change, or the current value if no new value was specified.

Examples:

>>> atol()
2.220446049250313e-16
>>> old = atol(1e-10)
>>> atol()
1e-10
>>> atol(old)
1e-10
>>> atol()
2.220446049250313e-16