macro_rules! assert_float_absolute_eq {
    ($a:expr, $b:expr, $epsilon:expr) => { ... };
    ($a:expr, $b:expr) => { ... };
}
Expand description

Assert the absolute error between two values is less than epsilon.

Panics if | a - b | > epsilon.

  • a - First float.
  • b - Second float.
  • epsilon - Absolute error tolerance between floats.

Examples

assert_float_absolute_eq!(3.0, 4.0, 1.0);
assert_float_absolute_eq!(1.0, 0.5 + 0.5);