diff --git a/Simplex/Fraction.php b/Simplex/Fraction.php index acf503b..7240077 100644 --- a/Simplex/Fraction.php +++ b/Simplex/Fraction.php @@ -70,7 +70,7 @@ public function getDenominator() public function canonicalize() { if ($this->d === '0') { - throw new \Exception('Division by zero.'); + throw new DivisionByZeroException('Division by zero.'); } $gcd = Helpers::gcd($this->n, $this->d); diff --git a/Simplex/exceptions.php b/Simplex/exceptions.php new file mode 100644 index 0000000..034f5eb --- /dev/null +++ b/Simplex/exceptions.php @@ -0,0 +1,16 @@ +