Implementing the ApproEq
traits, Can asserts that the two expressions are approximately equal to each other.
See the crate documentation for more details.
rust
assert_appro_eq!(1f64, 1.5f64, 0.6f64); // does not panic
assert_appro_eq!(0f64, 1e-12f64); // does not panic
rust:should_panic
assert_appro_eq!(1f64, 2f64); // panics
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.