public function dividir(Rational $r) { $num = $this->getNum() / $r->getNum(); $den = $this->getDen() / $r->getDen(); $nuevo = new Rational(); $nuevo->setNum($this->getNum()) / $r->getNum(); $nuevo->setDen($this->getDen() / $r->getDen()); }
public function Pow($rational) { } public function GCD() { $n1 = $this->numerator; $n2 = $this->denominator; do { while ($n2 < $n1) { $n1 -= $n2; } $temp = $n1; $n1 = $n2; $n2 = $temp; } while ($n1 > $n2); return $n1; } } class Polynomial { private $coefficients; public function __construct($coefficients) { $this->coefficients = $coefficients; } } $test = new Rational(3, -2); $t2 = $test->Div(new Rational(-2, 3)); //$test = new Rational(34,14); //echo $test->GCD(); $a = 1;