is_approx_eq : F64, F64, { rel : F64, abs : F64 } -> Bool
Returns True if a and b are equal within the given tolerances:
exactly equal (including +0.0/-0.0 and same-sign infinities), or both
finite with |a - b| <= max(abs, rel * max(|a|, |b|)).
rel: allowed difference as a fraction of the larger magnitude.abs: allowed difference regardless of magnitude; needed near zero.
NaN is never approximately equal to anything, including itself. An
infinity is only equal to the same infinity. This is not transitive, so do
not use it as equality for Dict/Set keys.
Crashes unless 0 <= rel <= 1 and abs is finite and >= 0.
expect F64.is_approx_eq(0.1 + 0.2, 0.3, { rel: 1e-12, abs: 0.0 })
expect F64.is_approx_eq(1e-20, 0.0, { rel: 1e-9, abs: 1e-12 })
expect !F64.is_approx_eq(1e-20, 0.0, { rel: 1e-9, abs: 0.0 })
expect !F64.is_approx_eq(F64.nan, F64.nan, { rel: 1.0, abs: 1.0 })