approx icon indicating copy to clipboard operation
approx copied to clipboard

assert_abs_diff_eq does not allow specifying epsilon

Open kaphula opened this issue 2 years ago • 1 comments

Why can't I specify custom epsilon with assert_abs_diff_eq but I can with abs_diff_eq

// not possible
assert_abs_diff_eq!(1.0, 1.0, epsilon = f64::EPSILON);

// possible
abs_diff_eq!(1.0, 1.0, epsilon = f64::EPSILON);

This makes me unable to write write Rust tests so that I can see the left and right values on test errors when setting epsilon is needed.

kaphula avatar Mar 11 '24 03:03 kaphula

It is possible to specify a custom epsilon, I do it a lot in the tests of my lambert_w crate. Perhaps there's some mistake?

JSorngard avatar Feb 08 '25 10:02 JSorngard