macro_rules! almost_equal {
($left:expr, $right:expr $(,)?) => { ... };
($left:expr, $right:expr, $($msg_args:tt)+) => { ... };
}Expand description
Panics if the provided values are not almost equal to eachother.
Uses the almost crate.
See the almost::equal documentation
for more details.
A debug-only version is available as chek::debug_almost_equal!.
Optionally may take an additional message to display on failure, which is formatted using standard format syntax.
ยงExample
chek::almost_equal!(4.0f32, 4.000001f32);
chek::almost_equal!(4.0, 4.0, "should be equal");