Macro all_asserts::assert_near
source · [−]macro_rules! assert_near {
($left:expr, $right:expr, $epsilon:expr $(,)?) => { ... };
($left:expr, $right:expr, $epsilon:expr, $($arg:tt)+ $(,)?) => { ... };
}
Expand description
Asserts that the right hand side expression is within the range on the left hand side
Examples
assert_near!(100.0, 100.9, 1.0);
assert_near!(100.9, 100.0, 1.0);