src/Core/Tolerance.php
public function getDifference($observed, $expected)
    {
        if ($this->unit == Tolerance::DA) {
            return abs($observed - $expected);
        }

        return abs(self::getDifferencePpm($observed, $expected));
    }
public function getDifference($observed, $expected)
    {
        if ($this->unit == Tolerance::DA) {
            return abs($observed - $expected);
        }

        return abs(self::getDifferencePpm($observed, $expected));
    }
public function getDifference ( $ observed , $ expected ) { if ( $ this -> unit == Tolerance :: DA ) { return abs ( $ observed - $ expected ) ; } return abs ( self :: getDifferencePpm ( $ observed , $ expected ) ) ; }
Gets the difference between the observed and expected, and returns it depending on the instance unit

@param float $observed
The observed value
@param float $expected
The expected value
@return float
Gets the difference between the observed and expected and returns it depending on the instance unit