src/Chippyash/Math/Type/Comparator/Native.php
protected function rationalCompare(RationalType $a, RationalType $b)
    {
        $res = $this->calculator->rationalSub($a, $b);

        if ($res->numerator()->get() == 0) {
            return 0;
        }
        if ($res->numerator()->get() < 0) {
            return -1;
        }
        return 1;
    }
protected function rationalCompare(RationalType $a, RationalType $b)
    {
        $res = $this->calculator->rationalSub($a, $b);

        if ($res->numerator()->get() == 0) {
            return 0;
        }
        if ($res->numerator()->get() < 0) {
            return -1;
        }
        return 1;
    }
protected function rationalCompare ( RationalType $ a , RationalType $ b ) { $ res = $ this -> calculator -> rationalSub ( $ a , $ b ) ; if ( $ res -> numerator ( ) -> get ( ) == 0 ) { return 0 ; } if ( $ res -> numerator ( ) -> get ( ) < 0 ) { return - 1 ; } return 1 ; }
Compare two rationals

@param  RationalType $a
@param  RationalType $b
@return int
Compare two rationals