@@ -45,8 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | return strval( |
48 | - $this->isIntOperation($type, $precision) ? (intval($leftOperand) + intval($rightOperand)) : |
|
49 | - round(floatval($leftOperand) + floatval($rightOperand), $precision, $this->getRoundingStrategy()) |
|
48 | + $this->isIntOperation($type, $precision) ? (intval($leftOperand) + intval($rightOperand)) : round(floatval($leftOperand) + floatval($rightOperand), $precision, $this->getRoundingStrategy()) |
|
50 | 49 | ); |
51 | 50 | } |
52 | 51 | |
@@ -72,8 +71,7 @@ discard block |
||
72 | 71 | } |
73 | 72 | |
74 | 73 | return strval( |
75 | - $this->isIntOperation($type, $precision) ? (intval($leftOperand) - intval($rightOperand)) : |
|
76 | - round($leftOperand - $rightOperand, $precision, $this->getRoundingStrategy()) |
|
74 | + $this->isIntOperation($type, $precision) ? (intval($leftOperand) - intval($rightOperand)) : round($leftOperand - $rightOperand, $precision, $this->getRoundingStrategy()) |
|
77 | 75 | ); |
78 | 76 | } |
79 | 77 | |
@@ -99,8 +97,7 @@ discard block |
||
99 | 97 | } |
100 | 98 | |
101 | 99 | return strval( |
102 | - $this->isIntOperation($type, $precision) ? (intval($leftOperand) * intval($rightOperand)) : |
|
103 | - round($leftOperand * $rightOperand, ($precision ?? 0), $this->getRoundingStrategy()) |
|
100 | + $this->isIntOperation($type, $precision) ? (intval($leftOperand) * intval($rightOperand)) : round($leftOperand * $rightOperand, ($precision ?? 0), $this->getRoundingStrategy()) |
|
104 | 101 | ); |
105 | 102 | } |
106 | 103 | |
@@ -126,8 +123,7 @@ discard block |
||
126 | 123 | } |
127 | 124 | |
128 | 125 | return strval( |
129 | - $this->isIntOperation($type, $precision) ? (intval($leftOperand) / intval($rightOperand)) : |
|
130 | - round($leftOperand / $rightOperand, $precision, $this->getRoundingStrategy()) |
|
126 | + $this->isIntOperation($type, $precision) ? (intval($leftOperand) / intval($rightOperand)) : round($leftOperand / $rightOperand, $precision, $this->getRoundingStrategy()) |
|
131 | 127 | ); |
132 | 128 | } |
133 | 129 | |
@@ -306,7 +302,7 @@ discard block |
||
306 | 302 | return $this->getNonPrecisionResult('gmp_fact', $operand); |
307 | 303 | } |
308 | 304 | |
309 | - $factorial = function (string $num) use (&$factorial) { |
|
305 | + $factorial = function(string $num) use (&$factorial) { |
|
310 | 306 | if ($num < 2) { |
311 | 307 | return 1; |
312 | 308 | } |
@@ -337,7 +333,7 @@ discard block |
||
337 | 333 | return $this->getNonPrecisionResult('gmp_gcd', $leftOperand, $rightOperand); |
338 | 334 | } |
339 | 335 | |
340 | - $gcd = function (string $a, string $b) use (&$gcd) { |
|
336 | + $gcd = function(string $a, string $b) use (&$gcd) { |
|
341 | 337 | return $b > .01 ? $gcd($b, strval(fmod(floatval($a), floatval($b)))) : $a; |
342 | 338 | }; |
343 | 339 | |
@@ -390,7 +386,7 @@ discard block |
||
390 | 386 | } |
391 | 387 | |
392 | 388 | $operand = (intval($operand) + 1); |
393 | - for ($i = $operand;; ++$i) { |
|
389 | + for ($i = $operand; ; ++$i) { |
|
394 | 390 | if ($this->isPrime(strval($i))) { |
395 | 391 | break; |
396 | 392 | } |