rust-nearly-eq

crates.io badge Build Status docs.rs Coverage Status

Implementing the NearlyEq traits, Can asserts that the two expressions are nearly(approximately) equal to each other.

How-to Use

See the crate documentation for more details.

Examples

rust assert_nearly_eq!(1f64, 1.5f64, 0.6f64); // does not panic assert_nearly_eq!(0f64, 1e-12f64); // does not panic

rust:should_panic assert_nearly_eq!(1f64, 2f64); // panics

Optional Features