pub struct Deviation { /* private fields */ }Expand description
How far a measured value misses the bound it fails, relative to that bound, as an interval sure to hold the exact relative deviation.
Both ends are at least zero; the upper end may be infinite (a bound of zero, or a value known only from one side).
Implementations§
Source§impl Deviation
impl Deviation
Sourcepub fn try_new(lower: f64, upper: f64) -> Option<Self>
pub fn try_new(lower: f64, upper: f64) -> Option<Self>
A relative deviation in [lower, upper]; None unless
0 <= lower <= upper (NaN refused).
Sourcepub fn below(minimum: f64, lower: f64, upper: f64) -> Self
pub fn below(minimum: f64, lower: f64, upper: f64) -> Self
The shortfall of a value in [lower, upper] below minimum, relative
to minimum: (minimum - value) / |minimum|, widened outwards so it
holds the exact quotient. A bound of zero makes any shortfall
infinitely large.
Sourcepub fn above(maximum: f64, lower: f64, upper: f64) -> Self
pub fn above(maximum: f64, lower: f64, upper: f64) -> Self
The excess of a value in [lower, upper] over maximum, relative to
maximum: (value - maximum) / |maximum|, widened outwards.
Sourcepub fn worst(self, other: Self) -> Self
pub fn worst(self, other: Self) -> Self
The larger of two deviations, as a finding naming several failing values is graded by the one missing most: an interval sure to hold the larger exact value.