Crates.io | nearly_eq |
lib.rs | nearly_eq |
version | 0.2.4 |
source | src |
created_at | 2017-10-05 19:06:30.05467 |
updated_at | 2018-03-28 01:41:46.783087 |
description | Nearly(Approximately) equal traits and assertion |
homepage | |
repository | https://github.com/chalharu/rust-nearly-eq |
max_upload_size | |
id | 34516 |
size | 53,881 |
Implementing the NearlyEq
traits, Can asserts that the two expressions are nearly(approximately) equal to each other.
See the crate documentation for more details.
assert_nearly_eq!(1f64, 1.5f64, 0.6f64); // does not panic
assert_nearly_eq!(0f64, 1e-12f64); // does not panic
assert_nearly_eq!(1f64, 2f64); // panics
complex
- Implement NearlyEq
traits for num_complex::Complex
. This adds a dependency on the num-complex
crate.
rational
- Implement NearlyEq
traits for num_rational::Ratio
. This adds a dependency on the num-rational
crate.
ndarray
- Implement NearlyEq
traits for ndarray::ArrayBase
. This adds a dependency on the ndarray
crate.
use_fpa
- Implement NearlyEq
traits for fixed-point types of fpa
crate.
i128
- Implement NearlyEq
traits for i128
and u128
. Available only on Rust nightly channel.