Skip to main content

approx_eq_ulps

Function approx_eq_ulps 

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

Compares two decimals with both absolute and relative tolerances.

Returns true if either tolerance check passes. This handles both small values (where absolute tolerance matters) and large values (where relative tolerance matters).