@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $rounded = $whole.'.'; |
| 50 | 50 | |
| 51 | - for ($i = 0;$i < $decimals;$i++) { |
|
| 51 | + for ($i = 0; $i < $decimals; $i++) { |
|
| 52 | 52 | $rounded .= $fractionalArr[$i]; |
| 53 | 53 | } |
| 54 | 54 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $total = strlen($fractional); |
| 131 | 131 | $fractional = ltrim($fractional, '0'); |
| 132 | 132 | |
| 133 | - return ($total - strlen($fractional)); |
|
| 133 | + return ($total-strlen($fractional)); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
@@ -216,9 +216,9 @@ |
||
| 216 | 216 | |
| 217 | 217 | if ($check == 1) { |
| 218 | 218 | $checkVal = $this->getDecimalPart(); |
| 219 | - $checkVal = trim($checkVal,'0'); |
|
| 219 | + $checkVal = trim($checkVal, '0'); |
|
| 220 | 220 | |
| 221 | - if (strlen($checkVal) > 0 ) { |
|
| 221 | + if (strlen($checkVal) > 0) { |
|
| 222 | 222 | return false; |
| 223 | 223 | } else { |
| 224 | 224 | return true; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | } elseif ($this->isEqual(0)) { |
| 28 | 28 | $answer = Numbers::makeZero(); |
| 29 | 29 | } else { |
| 30 | - $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $precision + 2); |
|
| 30 | + $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $precision+2); |
|
| 31 | 31 | $one = Numbers::makeOne($precision+2); |
| 32 | 32 | |
| 33 | 33 | if ($z->abs()->isGreaterThan(1)) { |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | } elseif ($this->isEqual(1)) { |
| 78 | 78 | $answer = Numbers::makeZero(); |
| 79 | 79 | } else { |
| 80 | - $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $precision + 2); |
|
| 81 | - $one = Numbers::makeOne($precision + 2); |
|
| 80 | + $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $precision+2); |
|
| 81 | + $one = Numbers::makeOne($precision+2); |
|
| 82 | 82 | |
| 83 | 83 | if ($z->abs()->isGreaterThan(1)) { |
| 84 | 84 | throw new IntegrityConstraint( |
@@ -128,9 +128,9 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | $precision = $precision ?? $this->getPrecision(); |
| 130 | 130 | |
| 131 | - $piDivTwo = Numbers::makePi($precision + 2)->divide(2, $precision + 2); |
|
| 131 | + $piDivTwo = Numbers::makePi($precision+2)->divide(2, $precision+2); |
|
| 132 | 132 | |
| 133 | - $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $precision + 2); |
|
| 133 | + $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $precision+2); |
|
| 134 | 134 | |
| 135 | 135 | $arctan = $z->arctan($precision+2, false); |
| 136 | 136 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | $precision = $precision ?? $this->getPrecision(); |
| 153 | 153 | |
| 154 | - $one = Numbers::makeOne($precision + 2); |
|
| 154 | + $one = Numbers::makeOne($precision+2); |
|
| 155 | 155 | $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $precision+2); |
| 156 | 156 | |
| 157 | 157 | if ($z->abs()->isLessThan(1)) { |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | ); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - $answer = $one->divide($z, $precision + 2)->arccos($precision + 2); |
|
| 165 | + $answer = $one->divide($z, $precision+2)->arccos($precision+2); |
|
| 166 | 166 | |
| 167 | 167 | if ($round) { |
| 168 | 168 | $answer = $answer->roundToPrecision($precision); |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | $precision = $precision ?? $this->getPrecision(); |
| 181 | 181 | |
| 182 | - $one = Numbers::makeOne($precision + 2); |
|
| 182 | + $one = Numbers::makeOne($precision+2); |
|
| 183 | 183 | $z = Numbers::makeOrDont(Numbers::IMMUTABLE, $this, $precision+2); |
| 184 | 184 | |
| 185 | 185 | if ($z->abs()->isLessThan(1)) { |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | ); |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - $answer = $one->divide($z, $precision + 2)->arcsin($precision + 2); |
|
| 193 | + $answer = $one->divide($z, $precision+2)->arcsin($precision+2); |
|
| 194 | 194 | |
| 195 | 195 | if ($round) { |
| 196 | 196 | $answer = $answer->roundToPrecision($precision); |
@@ -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; |