Expand description
Assert for comparing floating-point 32-bit numbers within 2.0 * EPSILON.
These macros are available:
assert_f64_eq!(a, b)≈ a = b (within 2ε)assert_f64_ne!(a, b)≈ a ≠ b (within 2ε)
§Example
use assertables::*;
let a: f64 = 1.0 / 3.0;
let b: f64 = 0.3333333333333335;
assert_f64_eq!(a, b);
let a: f64 = 1.0 / 3.0;
let b: f64 = 0.3333333333333339;
assert_f64_ne!(a, b);Modules§
- assert_
f64_ eq - Assert a floating point 64-bit number is equal to another within f64::EPSILON.
- assert_
f64_ ge - Assert a floating point 64-bit number is greater than or equal to another within f64::EPSILON.
- assert_
f64_ gt - Assert a floating point 64-bit number is greater than another within f64::EPSILON.
- assert_
f64_ le - Assert a floating point 64-bit number is equal to another within f64::EPSILON.
- assert_
f64_ lt - Assert a floating point 64-bit number is less than another within f64::EPSILON.
- assert_
f64_ ne - Assert a floating point 64-bit number is not equal to another within f64::EPSILON.