@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | */ |
173 | 173 | public static function createFromFoil(array $group1, array $group2): PolynomialFunction |
174 | 174 | { |
175 | - $group1exp = count($group1) - 1; |
|
176 | - $group2exp = count($group2) - 1; |
|
175 | + $group1exp = count($group1)-1; |
|
176 | + $group2exp = count($group2)-1; |
|
177 | 177 | |
178 | 178 | /** @var ImmutableDecimal[] $finalCoefs */ |
179 | 179 | $finalCoefs = []; |
@@ -198,16 +198,16 @@ discard block |
||
198 | 198 | * @var ImmutableDecimal $value1 |
199 | 199 | */ |
200 | 200 | foreach ($largerGroup as $key1 => $value1) { |
201 | - $largerKey = $largerExp - $key1; |
|
201 | + $largerKey = $largerExp-$key1; |
|
202 | 202 | |
203 | 203 | /** |
204 | 204 | * @var int $key2 |
205 | 205 | * @var ImmutableDecimal $value2 |
206 | 206 | */ |
207 | 207 | foreach ($smallerGroup as $key2 => $value2) { |
208 | - $smallerKey = $smallerExp - $key2; |
|
208 | + $smallerKey = $smallerExp-$key2; |
|
209 | 209 | $newVal = $value1->multiply($value2); |
210 | - $newExp = $largerKey + $smallerKey; |
|
210 | + $newExp = $largerKey+$smallerKey; |
|
211 | 211 | |
212 | 212 | if (isset($finalCoefs[$newExp])) { |
213 | 213 | $finalCoefs[$newExp] = $finalCoefs[$newExp]->add($newVal); |
@@ -44,7 +44,7 @@ |
||
44 | 44 | public function asCartesian(?int $scale = null): CartesianCoordinate |
45 | 45 | { |
46 | 46 | $scale = $scale ?? 10; |
47 | - $intScale = $scale + 2; |
|
47 | + $intScale = $scale+2; |
|
48 | 48 | |
49 | 49 | if (is_null($this->cachedCartesian)) { |
50 | 50 | $x = $this->getAxis('rho')->multiply($this->getAxis('theta')->cos($intScale))->roundToScale($scale); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | public function getDistanceFromOrigin(?int $scale = null): ImmutableDecimal |
77 | 77 | { |
78 | 78 | $scale = $scale ?? 10; |
79 | - $intScale = $scale + 2; |
|
79 | + $intScale = $scale+2; |
|
80 | 80 | |
81 | 81 | $x = 0; |
82 | 82 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | public function distanceTo(CoordinateInterface $coordinate, ?int $scale = null): ImmutableDecimal |
106 | 106 | { |
107 | 107 | $scale = $scale ?? 10; |
108 | - $intScale = $scale + 2; |
|
108 | + $intScale = $scale+2; |
|
109 | 109 | |
110 | 110 | if (!($coordinate instanceof CartesianCoordinate)) { |
111 | 111 | $coordinate = $coordinate->asCartesian(); |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | public function asPolar(?int $scale = null): PolarCoordinate |
228 | 228 | { |
229 | 229 | $scale = $scale ?? 10; |
230 | - $intScale = $scale + 3; |
|
230 | + $intScale = $scale+3; |
|
231 | 231 | |
232 | 232 | if ($this->numberOfDimensions() !== 2) { |
233 | 233 | throw new IncompatibleObjectState( |
@@ -113,7 +113,7 @@ |
||
113 | 113 | /** |
114 | 114 | * @return ImmutableDecimal|ImmutableFraction |
115 | 115 | */ |
116 | - abstract public function asReal(): ImmutableDecimal|ImmutableFraction; |
|
116 | + abstract public function asReal(): ImmutableDecimal | ImmutableFraction; |
|
117 | 117 | |
118 | 118 | /** |
119 | 119 | * @return string |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $scale = ($this->getScale() > $num->getScale()) ? $this->getScale() : $num->getScale(); |
69 | 69 | } |
70 | 70 | |
71 | - $scale = $scale + $this->numberOfLeadingZeros() + $num->numberOfLeadingZeros(); |
|
71 | + $scale = $scale+$this->numberOfLeadingZeros()+$num->numberOfLeadingZeros(); |
|
72 | 72 | |
73 | 73 | return ArithmeticProvider::divide($this->getAsBaseTenRealNumber(), $num->getAsBaseTenRealNumber(), $scale+1); |
74 | 74 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | $scale = ($this->getScale() > $num->getScale()) ? $this->getScale() : $num->getScale(); |
86 | 86 | |
87 | - $scale += $this->numberOfDecimalDigits() + $num->numberOfDecimalDigits(); |
|
87 | + $scale += $this->numberOfDecimalDigits()+$num->numberOfDecimalDigits(); |
|
88 | 88 | |
89 | 89 | if ($this->isWhole() && $num->isPositive() && $num->isWhole() && $num->isLessThan(PHP_INT_MAX)) { |
90 | 90 | return gmp_strval(gmp_pow($this->getAsBaseTenRealNumber(), $num->asInt())); |
@@ -11,10 +11,10 @@ |
||
11 | 11 | { |
12 | 12 | |
13 | 13 | protected function setValue( |
14 | - ImmutableDecimal|ImmutableFraction $realPart, |
|
15 | - ImmutableDecimal|ImmutableFraction $imaginaryPart, |
|
14 | + ImmutableDecimal | ImmutableFraction $realPart, |
|
15 | + ImmutableDecimal | ImmutableFraction $imaginaryPart, |
|
16 | 16 | ?int $scale = null |
17 | - ): static|ImmutableComplexNumber |
|
17 | + ): static | ImmutableComplexNumber |
|
18 | 18 | { |
19 | 19 | $scale = $scale ?? $this->getScale(); |
20 | 20 |
@@ -12,10 +12,10 @@ |
||
12 | 12 | { |
13 | 13 | |
14 | 14 | protected function setValue( |
15 | - ImmutableDecimal|ImmutableFraction $realPart, |
|
16 | - ImmutableDecimal|ImmutableFraction $imaginaryPart, |
|
15 | + ImmutableDecimal | ImmutableFraction $realPart, |
|
16 | + ImmutableDecimal | ImmutableFraction $imaginaryPart, |
|
17 | 17 | ?int $scale = null |
18 | - ): static|MutableComplexNumber |
|
18 | + ): static | MutableComplexNumber |
|
19 | 19 | { |
20 | 20 | $scale = $scale ?? $this->getScale(); |
21 | 21 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | ); |
61 | 61 | } |
62 | 62 | |
63 | - $internalScale = $scale + 2; |
|
63 | + $internalScale = $scale+2; |
|
64 | 64 | |
65 | 65 | $e = Numbers::makeE($internalScale); |
66 | 66 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ); |
97 | 97 | } |
98 | 98 | |
99 | - $internalScale = $scale + 2; |
|
99 | + $internalScale = $scale+2; |
|
100 | 100 | |
101 | 101 | $e = Numbers::makeE($internalScale); |
102 | 102 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | ); |
136 | 136 | } |
137 | 137 | |
138 | - $internalScale = $scale + 2; |
|
138 | + $internalScale = $scale+2; |
|
139 | 139 | |
140 | 140 | /** @var ImmutableDecimal $rangePdf */ |
141 | 141 | $rangePdf = |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | * @return ImmutableFraction|MutableFraction|static |
165 | 165 | * @throws IntegrityConstraint |
166 | 166 | */ |
167 | - public function abs(): ImmutableFraction|MutableFraction|static |
|
167 | + public function abs(): ImmutableFraction | MutableFraction | static |
|
168 | 168 | { |
169 | 169 | if ($this->isPositive()) { |
170 | 170 | return $this; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | /** |
251 | 251 | * @return ImmutableDecimal|ImmutableFraction |
252 | 252 | */ |
253 | - public function asReal(): ImmutableDecimal|ImmutableFraction |
|
253 | + public function asReal(): ImmutableDecimal | ImmutableFraction |
|
254 | 254 | { |
255 | 255 | return (new ImmutableFraction($this->getNumerator()->getAsBaseTenRealNumber(), $this->getDenominator()->getAsBaseTenRealNumber()))->setMode($this->getMode()); |
256 | 256 | } |
@@ -286,6 +286,6 @@ discard block |
||
286 | 286 | abstract protected function setValue( |
287 | 287 | ImmutableDecimal $numerator, |
288 | 288 | ImmutableDecimal $denominator |
289 | - ): MutableFraction|ImmutableFraction; |
|
289 | + ): MutableFraction | ImmutableFraction; |
|
290 | 290 | |
291 | 291 | } |
292 | 292 | \ No newline at end of file |