pub fn approx_equal(a: f64, b: f64) -> boolExpand description
Checks whether two floating-point numbers agree to the default tolerances.
Use this for calculated results. Invariants such as reset values, bounds or
period-one passthrough are exact and should be asserted with ==.
ยงExample
use nautilus_indicators::testing::approx_equal;
// At 1e6 the relative bound is 1e-3, which covers a gap of 1e-4.
assert!(approx_equal(1e6 + 1e-4, 1e6));
assert!(!approx_equal(1.0, 1.000_1));