approxEqual

Computes whether two values are approximately equal, admitting a maximum relative difference, or a maximum absolute difference.

  1. bool approxEqual(D1 x, D2 y, D3 maxRelDiff, D4 maxAbsDiff)
  2. bool approxEqual(D1 x, D2 y, D3 maxRelDiff)
  3. bool approxEqual(D1 x, D2 y)
    bool
    approxEqual
    (
    D1
    D2
    )
    (
    auto const ref D1 x
    ,
    auto const ref D2 y
    )
    if (
    isDecimal!(D1, D2)
    )

Parameters

x D1

First item to compare

y D2

Second item to compare

Return Value

Type: bool

true if the two items are approximately equal under either criterium. Notes: This operation is silent, does not throw any exceptions and it doesn't set any error flags.

Meta