[][src]Macro float_eq::float_ne

macro_rules! float_ne {
    ($a:expr, $b:expr, $($eq:ident <= $max_diff:expr),+) => { ... };
    ($a:expr, $b:expr, $($eq:ident <= $max_diff:expr),+,) => { ... };
}

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.

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) );