appro-eq

Crates.ioappro-eq
lib.rsappro-eq
version0.3.1
sourcesrc
created_at2017-10-24 02:42:02.879104
updated_at2020-06-21 23:08:54.053948
descriptionApproximately equal traits and assertion
homepage
repositoryhttps://github.com/chalharu/rust-appro-eq
max_upload_size
id36740
size76,473
(chalharu)

documentation

https://docs.rs/appro-eq/

README

rust-appro-eq

crates.io badge Build Status docs.rs Coverage Status

Implementing the ApproEq traits, Can asserts that the two expressions are approximately equal to each other.

How-to Use

See the crate documentation for more details.

Examples

assert_appro_eq!(1f64, 1.5f64, 0.6f64); // does not panic
assert_appro_eq!(0f64, 1e-12f64); // does not panic
assert_appro_eq!(1f64, 2f64); // panics

Optional Features

  • complex - Implement ApproEq traits for num_complex::Complex. This adds a dependency on the num-complex crate.

  • rational - Implement ApproEq traits for num_rational::Ratio. This adds a dependency on the num-rational crate.

  • ndarray - Implement ApproEq traits for ndarray::ArrayBase. This adds a dependency on the ndarray crate.

Commit count: 99

cargo fmt