angle_sc

Function is_within_tolerance

Source
pub fn is_within_tolerance<T>(reference: T, value: T, tolerance: T) -> bool
where T: PartialOrd + Copy + Sub<Output = T>,
Expand description

Check whether a value is within tolerance of a reference value.

  • reference the required value
  • value the value to test
  • tolerance the permitted tolerance

return true if abs(reference - value) is <= tolerance