IntervalProd.approx_equals

IntervalProd.approx_equals(self, other, atol)[source]

Return True if other is equal to this set up to atol.

Parameters
other :

Object to be tested.

atolfloat

Maximum allowed difference in maximum norm between the interval endpoints.

Examples

>>> rbox1 = IntervalProd(0, 0.5)
>>> rbox2 = IntervalProd(0, np.sqrt(0.5)**2)
>>> rbox1.approx_equals(rbox2, atol=0)  # Numerical error
False
>>> rbox1.approx_equals(rbox2, atol=1e-15)
True