Exemplo n.º 1
0
 /**
  * @param Rational $value
  * @return Rational
  */
 public function multiply(Rational $value) : Rational
 {
     $newNum = $this->num->getValue() * $value->getNumerator()->getValue();
     $newDenom = $this->denom->getValue() * $value->getDenominator()->getValue();
     return new static(integer($newNum), integer($newDenom));
 }