pub fn about_eq(a: f32, b: f32, granularity: f32) -> boolExpand description
f32 equality used in floating-point units.
NaNvalues are equal.INFINITYvalues are equal.NEG_INFINITYvalues are equal.- Finite values are equal if they fall in the same bucket sized by
granularity.
Note that this definition of equality is symmetric, reflexive, and transitive. This is slightly different them
equality defined by minimal distance epsilon, in some cases abs(a - b) < granularity can be true and not equal because they
are near a bucket threshold. In practice this does not mather given sufficient small granularity, it is more
stable due to the transitive property and enables the about_eq_hash function to always output the same hash for the same values.