public function divide(Fraction $fraction)
    {
        $numerator = $this->getNumerator() * $fraction->getDenominator();
        $denominator = $this->getDenominator() * $fraction->getNumerator();

        if ($denominator < 0) {
            $numerator *= -1;
        }

        return new static($numerator, abs($denominator));
    }
public function divide(Fraction $fraction)
    {
        $numerator = $this->getNumerator() * $fraction->getDenominator();
        $denominator = $this->getDenominator() * $fraction->getNumerator();

        if ($denominator < 0) {
            $numerator *= -1;
        }

        return new static($numerator, abs($denominator));
    }
public function divide ( Fraction $ fraction ) { $ numerator = $ this -> getNumerator ( ) * $ fraction -> getDenominator ( ) ; $ denominator = $ this -> getDenominator ( ) * $ fraction -> getNumerator ( ) ; if ( $ denominator < 0 ) { $ numerator *= - 1 ; } return new static ( $ numerator , abs ( $ denominator ) ) ; }
Divide this fraction by a given fraction

@author Tom Haskins-Vaughan <tom@tomhv.uk>
@since  0.1.0

@param Fraction $fraction

@return Fraction
Divide this fraction by a given fraction