Module assert_approx

Module assert_approx 

Source
Expand description

Assert for approximations.

These macros compare numbers, such as two floating point numbers, where one number may be very close to another number but not quite equal.

§Example

use assertables::*;

let a: f32 = 1.0000001;
let b: f32 = 1.0000011;
assert_approx_eq!(a, b);

Modules§

assert_approx_eq
Assert a number is approximately equal to another.
assert_approx_ne
Assert a number is approximately not equal to another.