Module assert_f32

Source
Expand description

Assert for comparing floating-point 32-bit numbers within 2.0 * EPSILON.

These macros are available:

§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.