@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | } else { |
44 | 44 | $abs = $this instanceof ImmutableDecimal ? $this->abs() : new ImmutableDecimal($this->absValue()); |
45 | 45 | $addScale = $abs->asInt() > $abs->getScale() ? $abs->asInt() : $abs->getScale(); |
46 | - $intScale = $scale + $addScale; |
|
46 | + $intScale = $scale+$addScale; |
|
47 | 47 | $x = new ImmutableDecimal($this->getValue(NumberBase::Ten), $intScale); |
48 | 48 | $x2 = $x->pow(2); |
49 | 49 | $one = new ImmutableDecimal(1, $intScale); |
50 | 50 | |
51 | - $aPart = new class($x2, $intScale) implements ContinuedFractionTermInterface{ |
|
51 | + $aPart = new class($x2, $intScale) implements ContinuedFractionTermInterface { |
|
52 | 52 | private ImmutableDecimal $x2; |
53 | 53 | private ImmutableDecimal $negTwo; |
54 | 54 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | }; |
78 | 78 | |
79 | - $bPart = new class() implements ContinuedFractionTermInterface{ |
|
79 | + $bPart = new class() implements ContinuedFractionTermInterface { |
|
80 | 80 | /** |
81 | 81 | * @param int $n |
82 | 82 | * @return ImmutableDecimal |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | } elseif ($this->isEqual(1)) { |
118 | 118 | $answer = Numbers::makeZero(); |
119 | 119 | } else { |
120 | - $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $scale + 2); |
|
120 | + $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $scale+2); |
|
121 | 121 | |
122 | 122 | $answer = $piDivTwo->subtract($z->arcsin($scale+2)); |
123 | 123 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | $scale = $scale ?? $this->getScale(); |
140 | 140 | $abs = $this instanceof ImmutableDecimal ? $this->abs() : new ImmutableDecimal($this->absValue()); |
141 | - $intScale = $scale + 2; |
|
141 | + $intScale = $scale+2; |
|
142 | 142 | $terms = $abs->multiply($intScale+8)->asInt(); |
143 | 143 | $x = new ImmutableDecimal($this->getValue(NumberBase::Ten), $intScale); |
144 | 144 | $aPart = new class($x) implements ContinuedFractionTermInterface { |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | return Numbers::makeZero($this->intScale); |
188 | 188 | } |
189 | 189 | |
190 | - return SequenceProvider::nthOddNumber($n - 1)->truncateToScale($this->intScale); |
|
190 | + return SequenceProvider::nthOddNumber($n-1)->truncateToScale($this->intScale); |
|
191 | 191 | } |
192 | 192 | }; |
193 | 193 | |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | |
209 | 209 | $scale = $scale ?? $this->getScale(); |
210 | 210 | |
211 | - $piDivTwo = Numbers::makePi($scale + 2)->divide(2, $scale + 2); |
|
211 | + $piDivTwo = Numbers::makePi($scale+2)->divide(2, $scale+2); |
|
212 | 212 | |
213 | - $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $scale + 2); |
|
213 | + $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $scale+2); |
|
214 | 214 | |
215 | 215 | $arctan = $z->arctan($scale+2, false); |
216 | 216 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | { |
230 | 230 | |
231 | 231 | $scale = $scale ?? $this->getScale(); |
232 | - $intScale = $scale + 2; |
|
232 | + $intScale = $scale+2; |
|
233 | 233 | |
234 | 234 | $one = Numbers::makeOne($intScale); |
235 | 235 | $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this->getValue(NumberBase::Ten), $intScale); |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | $answer = SeriesProvider::generalizedContinuedFraction( |
288 | 288 | $aPart, |
289 | 289 | $bPart, |
290 | - $intScale * 2, |
|
290 | + $intScale*2, |
|
291 | 291 | $intScale, |
292 | 292 | SeriesProvider::SUM_MODE_SUB |
293 | 293 | ); |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | { |
306 | 306 | |
307 | 307 | $scale = $scale ?? $this->getScale(); |
308 | - $intScale = $scale + 2; |
|
308 | + $intScale = $scale+2; |
|
309 | 309 | |
310 | 310 | $one = Numbers::makeOne($intScale); |
311 | 311 | $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $intScale); |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | $answer = SeriesProvider::generalizedContinuedFraction( |
361 | 361 | $aPart, |
362 | 362 | $bPart, |
363 | - $intScale * 2, |
|
363 | + $intScale*2, |
|
364 | 364 | $intScale, |
365 | 365 | SeriesProvider::SUM_MODE_ALT_FIRST_ADD |
366 | 366 | ); |
@@ -176,7 +176,7 @@ |
||
176 | 176 | $prevDenominator = new ImmutableDecimal(0, $scale); |
177 | 177 | $loop = 0; |
178 | 178 | |
179 | - for ($i = $terms;$i > 0;$i--) { |
|
179 | + for ($i = $terms; $i > 0; $i--) { |
|
180 | 180 | $loop++; |
181 | 181 | switch ($sumMode) { |
182 | 182 | case self::SUM_MODE_ADD: |