assertables

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§