Function multiplier

Source
pub fn multiplier(factor: f64) -> impl ApproximateEqualityEvaluator
Expand description

Creates an [ApproximateEqualityEvaluator] that operates by applying the given factor as a multiplier to determine approximate equality.

Examples found in repository?
examples/scalars.rs (line 20)
11fn main() {
12    {
13        println!();
14        println!("compare two f64 instances:");
15
16        let expected = 123456.0;
17        let actual = 123456.01;
18
19        // this one passes
20        assert_scalar_ne_approx!(expected, actual, multiplier(0.0));
21
22        // this one does not
23        assert_scalar_eq_approx!(expected, actual, multiplier(0.0));
24    }
25}