Macro float_eq::float_ne[][src]

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

Checks if two floating point expressions are not equal to each other.

See the top level documentation for a list of available comparison algorithms.

Examples

let a: f32 = 4.0;
let b: f32 = 4.1;

assert!(float_ne!(a, b, ulps <= 10));
assert!(float_ne!(a, b, rmax <= 2.0 * f32::EPSILON));
assert!(float_ne!(a - b, 0.0, abs <= 0.000_01));