@@ -24,7 +24,7 @@ |
||
24 | 24 | * @throws IntegrityConstraint |
25 | 25 | * @throws MissingPackage |
26 | 26 | */ |
27 | - public function continuousModulo(NumberInterface|string|int|float $mod): DecimalInterface |
|
27 | + public function continuousModulo(NumberInterface | string | int | float $mod): DecimalInterface |
|
28 | 28 | { |
29 | 29 | |
30 | 30 | $mod = Numbers::makeOrDont(Numbers::IMMUTABLE, $mod); |
@@ -37,14 +37,14 @@ discard block |
||
37 | 37 | return self::$pi->truncateToScale($digits)->getValue(NumberBase::Ten); |
38 | 38 | } |
39 | 39 | |
40 | - $internalScale = ($digits*2) + 10; |
|
40 | + $internalScale = ($digits*2)+10; |
|
41 | 41 | |
42 | 42 | $C = Numbers::make(Numbers::IMMUTABLE, '10005', $internalScale)->setMode(CalcMode::Precision)->sqrt($internalScale)->multiply(426880); |
43 | 43 | $M = Numbers::make(Numbers::IMMUTABLE, '1', $internalScale)->setMode(CalcMode::Precision); |
44 | 44 | $L = Numbers::make(Numbers::IMMUTABLE, '13591409', $internalScale)->setMode(CalcMode::Precision); |
45 | 45 | $K = Numbers::make(Numbers::IMMUTABLE, '6', $internalScale)->setMode(CalcMode::Precision); |
46 | 46 | $X = Numbers::make(Numbers::IMMUTABLE, '1')->setMode(CalcMode::Precision); |
47 | - $sum = Numbers::make(Numbers::MUTABLE,'0', $internalScale + 2)->setMode(CalcMode::Precision); |
|
47 | + $sum = Numbers::make(Numbers::MUTABLE, '0', $internalScale+2)->setMode(CalcMode::Precision); |
|
48 | 48 | $termNum = 0; |
49 | 49 | $one = Numbers::makeOne($internalScale)->setMode(CalcMode::Precision); |
50 | 50 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | return self::$e->truncateToScale($digits)->getValue(NumberBase::Ten); |
97 | 97 | } |
98 | 98 | |
99 | - $internalScale = $digits + 3; |
|
99 | + $internalScale = $digits+3; |
|
100 | 100 | |
101 | 101 | $one = Numbers::makeOne($internalScale+5)->setMode(CalcMode::Precision); |
102 | 102 | $denominator = Numbers::make(Numbers::MUTABLE, '1', $internalScale)->setMode(CalcMode::Precision); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * @return ImmutableDecimal|MutableDecimal|NumberInterface|ImmutableDecimal[]|MutableDecimal[]|NumberInterface[] |
115 | 115 | * @throws IntegrityConstraint |
116 | 116 | */ |
117 | - public static function makeOrDont(string|object $type, mixed $value, ?int $scale = null, NumberBase $base = NumberBase::Ten) |
|
117 | + public static function makeOrDont(string | object $type, mixed $value, ?int $scale = null, NumberBase $base = NumberBase::Ten) |
|
118 | 118 | { |
119 | 119 | |
120 | 120 | if (is_object($value)) { |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | } |
237 | 237 | |
238 | 238 | if ($scale > 100) { |
239 | - $pi = self::make(self::IMMUTABLE, ConstantProvider::makePi($scale+2), $scale + 2); |
|
239 | + $pi = self::make(self::IMMUTABLE, ConstantProvider::makePi($scale+2), $scale+2); |
|
240 | 240 | /** @var ImmutableDecimal */ |
241 | 241 | return $pi->multiply(2)->truncateToScale($scale); |
242 | 242 | } |
@@ -48,14 +48,14 @@ discard block |
||
48 | 48 | $e = Numbers::makeE($scale+$addScale); |
49 | 49 | $value = $e->pow($this); |
50 | 50 | } else { |
51 | - $intScale = ($this->numberOfIntDigits()) ? ($scale + 2) * $this->numberOfIntDigits() : ($scale + 2); |
|
52 | - $intScale = ($this->numberOfLeadingZeros()) ? $intScale * $this->numberOfLeadingZeros() : $intScale; |
|
51 | + $intScale = ($this->numberOfIntDigits()) ? ($scale+2)*$this->numberOfIntDigits() : ($scale+2); |
|
52 | + $intScale = ($this->numberOfLeadingZeros()) ? $intScale*$this->numberOfLeadingZeros() : $intScale; |
|
53 | 53 | $x = $this instanceof ImmutableDecimal ? $this : new ImmutableDecimal($this->getValue(NumberBase::Ten), $intScale); |
54 | 54 | $x2 = $x->pow(2); |
55 | 55 | $terms = $scale; |
56 | 56 | $six = new ImmutableDecimal(6, $intScale); |
57 | 57 | |
58 | - $aPart = new class($x2, $x) implements ContinuedFractionTermInterface{ |
|
58 | + $aPart = new class($x2, $x) implements ContinuedFractionTermInterface { |
|
59 | 59 | private ImmutableDecimal $x2; |
60 | 60 | private ImmutableDecimal $x; |
61 | 61 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | }; |
85 | 85 | |
86 | - $bPart = new class($x, $six, $intScale) implements ContinuedFractionTermInterface{ |
|
86 | + $bPart = new class($x, $six, $intScale) implements ContinuedFractionTermInterface { |
|
87 | 87 | private ImmutableDecimal $x; |
88 | 88 | private ImmutableDecimal $six; |
89 | 89 | private int $intScale; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | protected function lnScale(int $scale = null): string |
134 | 134 | { |
135 | 135 | $internalScale = $scale ?? $this->getScale(); |
136 | - $internalScale += 3 + $this->numberOfLeadingZeros(); |
|
136 | + $internalScale += 3+$this->numberOfLeadingZeros(); |
|
137 | 137 | |
138 | 138 | if (extension_loaded('decimal')) { |
139 | 139 | $decimalScale = max($internalScale*2, $this->numberOfTotalDigits()*2); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $answer = $adjustedNum; |
194 | 194 | |
195 | 195 | if ($exp2) { |
196 | - $answer = $answer->add(Numbers::makeNaturalLog2($internalScale + abs($exp2))->multiply($exp2)); |
|
196 | + $answer = $answer->add(Numbers::makeNaturalLog2($internalScale+abs($exp2))->multiply($exp2)); |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | if ($exp1p1) { |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | |
39 | 39 | $thisNum = Numbers::make(Numbers::IMMUTABLE, $this->getValue(NumberBase::Ten), $modScale); |
40 | 40 | |
41 | - $twoPi = Numbers::make2Pi($modScale + 2); |
|
42 | - $pi = Numbers::makePi( $scale + 2 ); |
|
41 | + $twoPi = Numbers::make2Pi($modScale+2); |
|
42 | + $pi = Numbers::makePi($scale+2); |
|
43 | 43 | |
44 | 44 | if ($pi->truncate($scale)->isEqual($thisNum->truncate($scale)) || $twoPi->truncate($scale)->isEqual($thisNum->truncate($scale))) { |
45 | 45 | return '0'; |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | |
52 | 52 | $answer = SeriesProvider::maclaurinSeries( |
53 | 53 | $modulo, |
54 | - function ($n) use ($scale, $negOne, $one) { |
|
54 | + function($n) use ($scale, $negOne, $one) { |
|
55 | 55 | |
56 | - return $n % 2 ? $negOne : $one; |
|
56 | + return $n%2 ? $negOne : $one; |
|
57 | 57 | }, |
58 | - function ($n) { |
|
58 | + function($n) { |
|
59 | 59 | return SequenceProvider::nthOddNumber($n); |
60 | 60 | }, |
61 | - function ($n) { |
|
61 | + function($n) { |
|
62 | 62 | return SequenceProvider::nthOddNumber($n)->factorial(); |
63 | 63 | }, |
64 | 64 | 0, |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | |
89 | 89 | $thisNum = Numbers::make(Numbers::IMMUTABLE, $this->getValue(NumberBase::Ten), $modScale); |
90 | 90 | |
91 | - $twoPi = Numbers::make2Pi($modScale + 2); |
|
92 | - $pi = Numbers::makePi( $modScale + 2); |
|
91 | + $twoPi = Numbers::make2Pi($modScale+2); |
|
92 | + $pi = Numbers::makePi($modScale+2); |
|
93 | 93 | $piDivTwo = $pi->divide(2); |
94 | 94 | |
95 | 95 | if ($twoPi->truncate($scale)->isEqual($thisNum->truncate($scale))) { |
@@ -113,14 +113,14 @@ discard block |
||
113 | 113 | |
114 | 114 | $answer = SeriesProvider::maclaurinSeries( |
115 | 115 | $modulo, |
116 | - function ($n) use ($negOne, $one) { |
|
116 | + function($n) use ($negOne, $one) { |
|
117 | 117 | |
118 | - return $n % 2 ? $negOne : $one; |
|
118 | + return $n%2 ? $negOne : $one; |
|
119 | 119 | }, |
120 | - function ($n) use ($intScale) { |
|
120 | + function($n) use ($intScale) { |
|
121 | 121 | return SequenceProvider::nthEvenNumber($n, $intScale); |
122 | 122 | }, |
123 | - function ($n) use ($intScale) { |
|
123 | + function($n) use ($intScale) { |
|
124 | 124 | return SequenceProvider::nthEvenNumber($n, $intScale)->factorial(); |
125 | 125 | }, |
126 | 126 | 0, |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | protected function tanScale(int $scale = null): string |
140 | 140 | { |
141 | 141 | $scale = $scale ?? $this->getScale(); |
142 | - $intScale = $scale + 4; |
|
142 | + $intScale = $scale+4; |
|
143 | 143 | $intScale = $intScale+$this->numberOfIntDigits()+$this->numberOfLeadingZeros(); |
144 | 144 | |
145 | 145 | $thisNum = Numbers::make(Numbers::IMMUTABLE, $this->getValue(NumberBase::Ten), $intScale); |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | |
287 | 287 | if ($mod2Pi->isEqual(0)) { |
288 | 288 | return static::INFINITY; |
289 | - } elseif($modPi->isEqual(0)) { |
|
289 | + } elseif ($modPi->isEqual(0)) { |
|
290 | 290 | return static::NEG_INFINITY; |
291 | 291 | } |
292 | 292 |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $total = strlen($fractional); |
148 | 148 | $fractional = ltrim($fractional, '0'); |
149 | 149 | |
150 | - return ($total - strlen($fractional)); |
|
150 | + return ($total-strlen($fractional)); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function numberOfTotalDigits(): int |
159 | 159 | { |
160 | - return $this->numberOfDecimalDigits() + $this->numberOfIntDigits(); |
|
160 | + return $this->numberOfDecimalDigits()+$this->numberOfIntDigits(); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @param DecimalInterface $num |
16 | 16 | * @return int|float |
17 | 17 | */ |
18 | - protected static function translateToNative(DecimalInterface $num): int|float |
|
18 | + protected static function translateToNative(DecimalInterface $num): int | float |
|
19 | 19 | { |
20 | 20 | return ($num->isInt() ? $num->asInt() : $num->asFloat()); |
21 | 21 | } |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | * @param DecimalInterface $num |
25 | 25 | * @return int|float |
26 | 26 | */ |
27 | - protected function addNative(DecimalInterface $num): int|float |
|
27 | + protected function addNative(DecimalInterface $num): int | float |
|
28 | 28 | { |
29 | 29 | $left = self::translateToNative($this); |
30 | 30 | $right = self::translateToNative($num); |
31 | 31 | |
32 | - $value = $left + $right; |
|
32 | + $value = $left+$right; |
|
33 | 33 | return (string)$value; |
34 | 34 | } |
35 | 35 | |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | * @param DecimalInterface $num |
38 | 38 | * @return int|float |
39 | 39 | */ |
40 | - protected function subtractNative(DecimalInterface $num): int|float |
|
40 | + protected function subtractNative(DecimalInterface $num): int | float |
|
41 | 41 | { |
42 | 42 | $left = self::translateToNative($this); |
43 | 43 | $right = self::translateToNative($num); |
44 | 44 | |
45 | - $value = $left - $right; |
|
45 | + $value = $left-$right; |
|
46 | 46 | return (string)$value; |
47 | 47 | } |
48 | 48 | |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | * @param DecimalInterface $num |
51 | 51 | * @return int|float |
52 | 52 | */ |
53 | - protected function multiplyNative(DecimalInterface $num): int|float |
|
53 | + protected function multiplyNative(DecimalInterface $num): int | float |
|
54 | 54 | { |
55 | 55 | $left = self::translateToNative($this); |
56 | 56 | $right = self::translateToNative($num); |
57 | 57 | |
58 | - $value = $left * $right; |
|
58 | + $value = $left*$right; |
|
59 | 59 | return (string)$value; |
60 | 60 | } |
61 | 61 | |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | * @param DecimalInterface $num |
64 | 64 | * @return int|float |
65 | 65 | */ |
66 | - protected function divideNative(DecimalInterface $num): int|float |
|
66 | + protected function divideNative(DecimalInterface $num): int | float |
|
67 | 67 | { |
68 | 68 | $left = self::translateToNative($this); |
69 | 69 | $right = self::translateToNative($num); |
70 | 70 | |
71 | - $value = $left / $right; |
|
71 | + $value = $left/$right; |
|
72 | 72 | return (string)$value; |
73 | 73 | } |
74 | 74 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @param DecimalInterface $num |
77 | 77 | * @return int|float |
78 | 78 | */ |
79 | - protected function powNative(DecimalInterface $num): int|float |
|
79 | + protected function powNative(DecimalInterface $num): int | float |
|
80 | 80 | { |
81 | 81 | $left = self::translateToNative($this); |
82 | 82 | $right = self::translateToNative($num); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | /** |
89 | 89 | * @return int|float |
90 | 90 | */ |
91 | - protected function sqrtNative(): int|float |
|
91 | + protected function sqrtNative(): int | float |
|
92 | 92 | { |
93 | 93 | $value = sqrt($this->asFloat()); |
94 | 94 | return (string)$value; |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | if ($exp > 0) { |
107 | 107 | $exp -= strlen($right); |
108 | 108 | if ($exp >= 0) { |
109 | - $right = str_pad($right, $exp - 1, '0').'.0'; |
|
109 | + $right = str_pad($right, $exp-1, '0').'.0'; |
|
110 | 110 | } else { |
111 | - $right = substr($right, 0, strlen($right) + abs($exp)).'.'.substr($right, strlen($right) + abs($exp) + 1); |
|
111 | + $right = substr($right, 0, strlen($right)+abs($exp)).'.'.substr($right, strlen($right)+abs($exp)+1); |
|
112 | 112 | } |
113 | 113 | } else { |
114 | 114 | $exp += strlen($left); |
115 | 115 | if ($exp >= 0) { |
116 | - $left = substr($left, 0, $exp).'.'.substr($left, $exp + 1); |
|
116 | + $left = substr($left, 0, $exp).'.'.substr($left, $exp+1); |
|
117 | 117 | } else { |
118 | 118 | $left = '0.'.str_pad($left, abs($exp)+1, '0', STR_PAD_LEFT); |
119 | 119 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | * @param NumberBase $base |
259 | 259 | * @return DecimalInterface|NumberInterface |
260 | 260 | */ |
261 | - public function setBase(NumberBase $base): DecimalInterface|NumberInterface |
|
261 | + public function setBase(NumberBase $base): DecimalInterface | NumberInterface |
|
262 | 262 | { |
263 | 263 | $this->base = $base; |
264 | 264 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | * |
271 | 271 | * @return DecimalInterface|NumberInterface |
272 | 272 | */ |
273 | - public function abs(): DecimalInterface|NumberInterface |
|
273 | + public function abs(): DecimalInterface | NumberInterface |
|
274 | 274 | { |
275 | 275 | $newValue = $this->absValue(); |
276 | 276 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | * @param DecimalInterface $num |
282 | 282 | * @return float|int |
283 | 283 | */ |
284 | - protected static function translateToNative(DecimalInterface $num): float|int |
|
284 | + protected static function translateToNative(DecimalInterface $num): float | int |
|
285 | 285 | { |
286 | 286 | return ($num->isInt() ? $num->asInt() : $num->asFloat()); |
287 | 287 | } |
@@ -334,13 +334,13 @@ discard block |
||
334 | 334 | * @param bool $setToNewBase |
335 | 335 | * @return DecimalInterface |
336 | 336 | */ |
337 | - abstract protected function setValue(string $value, ?int $scale = null, ?NumberBase $base = null, bool $setToNewBase = false): DecimalInterface; // TODO: Check usages for base correctness & preservation |
|
337 | + abstract protected function setValue(string $value, ?int $scale = null, ?NumberBase $base = null, bool $setToNewBase = false): DecimalInterface;// TODO: Check usages for base correctness & preservation |
|
338 | 338 | |
339 | 339 | /** |
340 | 340 | * @param NumberInterface|string|int|float $mod |
341 | 341 | * @return DecimalInterface |
342 | 342 | */ |
343 | - abstract public function continuousModulo(NumberInterface|string|int|float $mod): DecimalInterface; |
|
343 | + abstract public function continuousModulo(NumberInterface | string | int | float $mod): DecimalInterface; |
|
344 | 344 | |
345 | 345 | /** |
346 | 346 | * @param string $decimalPart |
@@ -20,57 +20,57 @@ discard block |
||
20 | 20 | { |
21 | 21 | |
22 | 22 | const EULER_ZIGZAG = [ |
23 | - '1', // 0 |
|
24 | - '1', // 1 |
|
25 | - '1', // 2 |
|
26 | - '2', // 3 |
|
27 | - '5', // 4 |
|
28 | - '16', // 5 |
|
29 | - '61', // 6 |
|
30 | - '272', // 7 |
|
31 | - '1385', // 8 |
|
32 | - '7936', // 9 |
|
33 | - '50521', // 10 |
|
34 | - '353792', // 11 |
|
35 | - '2702765', // 12 |
|
36 | - '22368256', // 13 |
|
37 | - '199360981', // 14 |
|
38 | - '1903757312', // 15 |
|
39 | - '19391512145', // 16 |
|
40 | - '209865342976', // 17 |
|
41 | - '2404879675441', // 18 |
|
42 | - '29088885112832', // 19 |
|
43 | - '370371188237525', // 20 |
|
44 | - '4951498053124096', // 21 |
|
45 | - '69348874393137901', // 22 |
|
46 | - '1015423886506852352', // 23 |
|
47 | - '15514534163557086905', // 24 |
|
48 | - '246921480190207983616', // 25 |
|
49 | - '4087072509293123892361', // 26 |
|
50 | - '70251601603943959887872', // 27 |
|
51 | - '1252259641403629865468285', // 28 |
|
52 | - '23119184187809597841473536', // 29 |
|
53 | - '441543893249023104553682821', // 30 |
|
54 | - '8713962757125169296170811392', // 31 |
|
55 | - '177519391579539289436664789665', // 32 |
|
56 | - '3729407703720529571097509625856', // 33 |
|
57 | - '80723299235887898062168247453281', // 34 |
|
58 | - '1798651693450888780071750349094912', // 35 |
|
59 | - '41222060339517702122347079671259045', // 36 |
|
60 | - '970982810785059112379399707952152576', // 37 |
|
61 | - '23489580527043108252017828576198947741', // 38 |
|
62 | - '583203324917310043943191641625494290432', // 39 |
|
63 | - '14851150718114980017877156781405826684425', // 40 |
|
64 | - '387635983772083031828014624002175135645696', // 41 |
|
65 | - '10364622733519612119397957304745185976310201', // 42 |
|
66 | - '283727921907431909304183316295787837183229952', // 43 |
|
67 | - '7947579422597592703608040510088070619519273805', // 44 |
|
68 | - '227681379129930886488600284336316164603920777216', // 45 |
|
69 | - '6667537516685544977435028474773748197524107684661', // 46 |
|
70 | - '199500252157859031027160499643195658166340757225472', // 47 |
|
71 | - '6096278645568542158691685742876843153976539044435185', // 48 |
|
72 | - '190169564657928428175235445073924928592047775873499136', // 49 |
|
73 | - '6053285248188621896314383785111649088103498225146815121', // 50 |
|
23 | + '1', // 0 |
|
24 | + '1', // 1 |
|
25 | + '1', // 2 |
|
26 | + '2', // 3 |
|
27 | + '5', // 4 |
|
28 | + '16', // 5 |
|
29 | + '61', // 6 |
|
30 | + '272', // 7 |
|
31 | + '1385', // 8 |
|
32 | + '7936', // 9 |
|
33 | + '50521', // 10 |
|
34 | + '353792', // 11 |
|
35 | + '2702765', // 12 |
|
36 | + '22368256', // 13 |
|
37 | + '199360981', // 14 |
|
38 | + '1903757312', // 15 |
|
39 | + '19391512145', // 16 |
|
40 | + '209865342976', // 17 |
|
41 | + '2404879675441', // 18 |
|
42 | + '29088885112832', // 19 |
|
43 | + '370371188237525', // 20 |
|
44 | + '4951498053124096', // 21 |
|
45 | + '69348874393137901', // 22 |
|
46 | + '1015423886506852352', // 23 |
|
47 | + '15514534163557086905', // 24 |
|
48 | + '246921480190207983616', // 25 |
|
49 | + '4087072509293123892361', // 26 |
|
50 | + '70251601603943959887872', // 27 |
|
51 | + '1252259641403629865468285', // 28 |
|
52 | + '23119184187809597841473536', // 29 |
|
53 | + '441543893249023104553682821', // 30 |
|
54 | + '8713962757125169296170811392', // 31 |
|
55 | + '177519391579539289436664789665', // 32 |
|
56 | + '3729407703720529571097509625856', // 33 |
|
57 | + '80723299235887898062168247453281', // 34 |
|
58 | + '1798651693450888780071750349094912', // 35 |
|
59 | + '41222060339517702122347079671259045', // 36 |
|
60 | + '970982810785059112379399707952152576', // 37 |
|
61 | + '23489580527043108252017828576198947741', // 38 |
|
62 | + '583203324917310043943191641625494290432', // 39 |
|
63 | + '14851150718114980017877156781405826684425', // 40 |
|
64 | + '387635983772083031828014624002175135645696', // 41 |
|
65 | + '10364622733519612119397957304745185976310201', // 42 |
|
66 | + '283727921907431909304183316295787837183229952', // 43 |
|
67 | + '7947579422597592703608040510088070619519273805', // 44 |
|
68 | + '227681379129930886488600284336316164603920777216', // 45 |
|
69 | + '6667537516685544977435028474773748197524107684661', // 46 |
|
70 | + '199500252157859031027160499643195658166340757225472', // 47 |
|
71 | + '6096278645568542158691685742876843153976539044435185', // 48 |
|
72 | + '190169564657928428175235445073924928592047775873499136', // 49 |
|
73 | + '6053285248188621896314383785111649088103498225146815121', // 50 |
|
74 | 74 | ]; |
75 | 75 | |
76 | 76 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $sequence = new NumberCollection(); |
90 | 90 | |
91 | 91 | for ($i = 0;$i < $collectionSize;$i++) { |
92 | - $sequence->push(self::nthOddNumber($n + $i)); |
|
92 | + $sequence->push(self::nthOddNumber($n+$i)); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | return $sequence; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $sequence = new NumberCollection(); |
123 | 123 | |
124 | 124 | for ($i = 0;$i < $collectionSize;$i++) { |
125 | - $sequence->push(self::nthEvenNumber($n + $i)); |
|
125 | + $sequence->push(self::nthEvenNumber($n+$i)); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | return $sequence; |
@@ -154,13 +154,13 @@ discard block |
||
154 | 154 | $sequence = new NumberCollection(); |
155 | 155 | |
156 | 156 | for ($i = 0;$i < $collectionSize;$i++) { |
157 | - $sequence->push(self::nthPowerNegativeOne($n + $i)); |
|
157 | + $sequence->push(self::nthPowerNegativeOne($n+$i)); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | return $sequence; |
161 | 161 | } |
162 | 162 | |
163 | - return ($n % 2 ? new ImmutableDecimal(-1) : new ImmutableDecimal(1)); |
|
163 | + return ($n%2 ? new ImmutableDecimal(-1) : new ImmutableDecimal(1)); |
|
164 | 164 | |
165 | 165 | } |
166 | 166 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $sequence = new NumberCollection(); |
182 | 182 | |
183 | 183 | for ($i = 0;$i < $collectionSize;$i++) { |
184 | - $sequence->push(self::nthEulerZigzag($n + $i)); |
|
184 | + $sequence->push(self::nthEulerZigzag($n+$i)); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | return $sequence; |