Function unit_test_utils::assert_nearly_equal
source · pub fn assert_nearly_equal<T>(a: T, b: T, rel_tol: T, abs_tol: T, msg: &'static str)where
T: Float + Zero,
Expand description
Asserts that two numbers are nearly equal
Arguments
a
first floatb
second floatrel_tol
relative tolerance (must be positive)abs_tol
absolute tolerance (must be positive)msg
an error message that will be thrown if the two numbers are not nearly equal
Panics
The function panics if the two floating-point numbers are not almost equal to one another up to the specified tolerances