isclose

This crate provides a set of traits and macros for comparing arbitrary types.
The trait IsClose is implemented by default for f32 and f64.
Additional implementations are also hidden behind the following features:
halfimplementsIsClosefor half'sf16andbf16euclidimplementsIsClosefor euclid's geometric types
Usage:
use ;
// This will fail!
// assert_eq!(0.1 + 0.2, 0.3)
// This will pass
assert!;
// Equivalent, but gives better error messages
assert_is_close!;
You can also implement IsClose for custom types
use ;
use Borrow;
assert_is_close!
Licence
Licensed under either of
- Apache License, Version 2.0 (LICENCE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENCE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.