is_close#

static MathUtils.is_close(a: float, b: float, relative_tolerance: float = 1e-09, absolute_tolerance: float = 0.0) bool#

Whether two numbers are close to each other given relative and absolute tolerances.

Parameters:
afloat, int

First number to compare.

bfloat, int

Second number to compare.

relative_tolerancefloat

Relative tolerance. The default value is 1e-9.

absolute_tolerancefloat

Absolute tolerance. The default value is 0.0.

Returns:
bool

True if the two numbers are closed, False otherwise.