fn compare_floats(val: f64, other: f64) -> Option<Ordering> {
            let prec = f64::EPSILON.max(val.abs() * f64::EPSILON);

            if (other - val).abs() < prec {
                return Some(Ordering::Equal);
            }

            val.partial_cmp(&other)
        }
// Compare two floating point numbers. The decision interval for equality is dynamically
// scaled as the value being compared increases in magnitude.
Compare two floating point numbers. The decision interval for equality is dynamically
scaled as the value being compared increases in magnitude.
Compare two floating point numbers . The decision interval for equality is dynamically scaled as the value being compared increases in magnitude .
fn compare_floats(val: f64, other: f64) -> Option<Ordering> {
            let prec = f64::EPSILON.max(val.abs() * f64::EPSILON);
            if (other - val).abs() < prec {
                return Some(Ordering::Equal);
            }
            val.partial_cmp(&other)
        }
fn compare_floats ( val : f64 , other : f64 ) -> Option < Ordering > { let prec = f64 :: EPSILON . max ( val . abs ( ) * f64 :: EPSILON ) ; if ( other - val ) . abs ( ) < prec { return Some ( Ordering :: Equal ) ; } val . partial_cmp ( & other ) }
Compare two floating point numbers.
Compare two floating point numbers .
val
f64
other
f64