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