We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 36ca9f6 + f252335 commit 8f6ca61Copy full SHA for 8f6ca61
2 files changed
composer.json
@@ -1,6 +1,6 @@
1
{
2
"name": "macocci7/php-math-integer",
3
- "version": "1.0.1",
+ "version": "1.0.2",
4
"description": "PHP Math Library of the subjects of number theory(only natural number).",
5
"type": "library",
6
"license": "MIT",
src/Fraction.php
@@ -164,6 +164,9 @@ public function reduce()
164
*/
165
public function toCommonDenominator(Fraction &$f)
166
167
+ if (0 === (int) $this->denominator || 0 === (int) $f->denominator) {
168
+ throw new \Exception('denominator must not be null nor zero.', 1);
169
+ }
170
$cd = $this->m->leastCommonMultiple(
171
$this->denominator,
172
$f->denominator
0 commit comments