[−][src]Macro float_eq::assert_float_ne
Asserts that two floating point expressions are not equal to each other (using float_ne!).
abs <= max_diffis an absolute epsilon comparison.rel <= max_diffis a relative epsilon comparison.ulps <= max_diffis an ULPs comparison.
On panic, this macro will print the values of the expressions with their debug
representations, with additional information from the comparison operations
(using FloatEq and FloatDiff).
Like assert!, this macro has a second form, where a custom panic message can
be provided.
Examples
let a: f32 = 4.; let b: f32 = 4.1; assert_float_ne!(a, 3.9999990, rel <= f32::EPSILON); assert_float_ne!(a - b, 0., abs <= 0.00001, rel <= f32::EPSILON); assert_float_ne!(a - b, 0., abs <= 0.00001, ulps <= 10); assert_float_ne!(a - b, 0., abs <= 0.00001, ulps <= 10, "Checking that {} != {}", a, b);