[−][src]Macro float_eq::float_ne
Checks whether two floating point expressions are not equal to each other (using FloatEq
).
Comparisons are applied in order from left to right, shortcutting to return early if a positive result is found.
abs <= max_diff
is an absolute epsilon comparison.rel <= max_diff
is a relative epsilon comparison.ulps <= max_diff
is an ULPs comparison.
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) );