Skip to main content

within

Function within 

fn within(ours: f64, others: f64, tolerance: f64) -> bool
Expand description

true when the two values agree to a relative tolerance.

Relative to the larger magnitude, so the test does not become an absolute one as the values grow; two zeroes agree exactly, which the general formula would divide by.