private function normalize()
    {
        $gcd = Math::gcd($this->p, $this->q);

        if ($gcd == 0) throw new DivisionByZeroException();

        $this->p = $this->p/$gcd;
        $this->q = $this->q/$gcd;

        if ($this->q < 0) {
            $this->p = -$this->p;
            $this->q = -$this->q;
        }
    }