Trait PercentDiff

Source
pub trait PercentDiff<Rhs = Self> {
    type Output;

    // Required method
    fn percent_diff(self, rhs: Rhs) -> Self::Output;
}
Expand description

Compute the percentage difference between two values. The percentage difference is defined as:

percent_diff = |x, y| 100 * |x - y| / ((|x| + |y|) / 2)

Required Associated Types§

Required Methods§

Source

fn percent_diff(self, rhs: Rhs) -> Self::Output

Implementors§