approx_eq_relative

Function approx_eq_relative 

Source
pub fn approx_eq_relative(
    a: Decimal,
    b: Decimal,
    relative_tolerance: Decimal,
) -> bool
Expand description

Compares two decimals with a relative tolerance.

Returns true if |a - b| <= max(|a|, |b|) * relative_tolerance.

For comparing values near zero, use approx_eq with an absolute tolerance instead.