@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | $rounded = $whole.'.'; |
56 | 56 | |
57 | - for ($i = 0;$i < $decimals;$i++) { |
|
57 | + for ($i = 0; $i < $decimals; $i++) { |
|
58 | 58 | $rounded .= $fractionalArr[$i]; |
59 | 59 | } |
60 | 60 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $total = strlen($fractional); |
143 | 143 | $fractional = ltrim($fractional, '0'); |
144 | 144 | |
145 | - return ($total - strlen($fractional)); |
|
145 | + return ($total-strlen($fractional)); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | public function isFloat(): bool |
225 | 225 | { |
226 | 226 | |
227 | - return (bool)ArithmeticProvider::compare($this->getDecimalPart(), '0'); |
|
227 | + return (bool) ArithmeticProvider::compare($this->getDecimalPart(), '0'); |
|
228 | 228 | |
229 | 229 | } |
230 | 230 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | throw new IncompatibleObjectState('Cannot export number as integer because it is out of range'); |
236 | 236 | } |
237 | 237 | |
238 | - return (float)$this->asReal(); |
|
238 | + return (float) $this->asReal(); |
|
239 | 239 | |
240 | 240 | } |
241 | 241 |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | */ |
314 | 314 | public function rotate(bool $clockwise = true): MatrixInterface |
315 | 315 | { |
316 | - $tempData = $clockwise ? $this->rows : $this->columns; |
|
316 | + $tempData = $clockwise ? $this->rows : $this->columns; |
|
317 | 317 | $mode = $clockwise ? self::MODE_COLUMNS_INPUT : self::MODE_ROWS_INPUT; |
318 | 318 | |
319 | 319 | $tempData = array_reverse($tempData); |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | |
466 | 466 | foreach ($this->rows as $rowKey => $row) { |
467 | 467 | $resultArray[$rowKey] = new NumberCollection(); |
468 | - for ($i = 0;$i < $value->getColumnCount();$i++) { |
|
468 | + for ($i = 0; $i < $value->getColumnCount(); $i++) { |
|
469 | 469 | $cellVal = Numbers::makeZero(); |
470 | 470 | /** @var NumberInterface $num */ |
471 | 471 | foreach ($row->toArray() as $index => $num) { |
@@ -508,8 +508,8 @@ discard block |
||
508 | 508 | $newMatrixData = []; |
509 | 509 | |
510 | 510 | // TODO: Implement minors & cofactors method https://www.mathsisfun.com/algebra/matrix-inverse-minors-cofactors-adjugate.html |
511 | - for ($i = 0;$i < $columnCount;$i++) { |
|
512 | - for ($r = 0;$r < $columnCount;$r++) { |
|
511 | + for ($i = 0; $i < $columnCount; $i++) { |
|
512 | + for ($r = 0; $r < $columnCount; $r++) { |
|
513 | 513 | |
514 | 514 | } |
515 | 515 | } |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | |
537 | 537 | $newRows = []; |
538 | 538 | |
539 | - for ($i = 0;$i < $this->getRowCount();$i++) { |
|
539 | + for ($i = 0; $i < $this->getRowCount(); $i++) { |
|
540 | 540 | if ($i === $excludeRow) { |
541 | 541 | continue; |
542 | 542 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | $this->base = $base; |
39 | 39 | |
40 | - $value = (string)$value; |
|
40 | + $value = (string) $value; |
|
41 | 41 | |
42 | 42 | if (strpos($value, 'i') !== false) { |
43 | 43 | $this->imaginary = true; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $this->precision = ($precision > strlen($this->getDecimalPart())) ? $precision : strlen($this->getDecimalPart()); |
65 | 65 | } else { |
66 | 66 | $checkVal = $this->getDecimalPart(); |
67 | - $checkVal = trim($checkVal,'0'); |
|
67 | + $checkVal = trim($checkVal, '0'); |
|
68 | 68 | |
69 | 69 | if (strlen($checkVal) > 0) { |
70 | 70 | $this->precision = (strlen($this->getDecimalPart()) > 10) ? strlen($this->getDecimalPart()) : 10; |
@@ -102,14 +102,14 @@ discard block |
||
102 | 102 | if ($exp > 0) { |
103 | 103 | $exp -= strlen($right); |
104 | 104 | if ($exp >= 0) { |
105 | - $right = str_pad($right, $exp - 1, '0').'.0'; |
|
105 | + $right = str_pad($right, $exp-1, '0').'.0'; |
|
106 | 106 | } else { |
107 | - $right = substr($right, 0, strlen($right) + $exp).'.'.substr($right, strlen($right) + $exp + 1); |
|
107 | + $right = substr($right, 0, strlen($right)+$exp).'.'.substr($right, strlen($right)+$exp+1); |
|
108 | 108 | } |
109 | 109 | } else { |
110 | 110 | $exp += strlen($left); |
111 | 111 | if ($exp >= 0) { |
112 | - $left = substr($left, 0, $exp).'.'.substr($left, $exp + 1); |
|
112 | + $left = substr($left, 0, $exp).'.'.substr($left, $exp+1); |
|
113 | 113 | } else { |
114 | 114 | $left = '0.'.str_pad($left, $exp, '0', STR_PAD_LEFT); |
115 | 115 | } |