[−][src]Trait ntest::MaxDifference
Helper trait for assert_about_equal
macro. Returns the max difference between
two vectors of floats. Can also be used for single floats.
Examples
Compare two floating numbers:
assert!((0.1f64 - 42.1f32.max_diff(42.0f32)) < 1.0e-4f64);
Compare two vectors. Returns the maximum difference in the vectors. In this case ~0.1.:
assert!(0.1f64 - vec![42.0, 42.0f32, 1.001f32].max_diff(vec![42.0, 42.1f32, 1.0f32]) < 1.0e-4f64);