@@ -142,10 +142,11 @@ discard block |
||
142 | 142 | $mid = 0; |
143 | 143 | for ($i = 0; $i < count($bs); $i++) { |
144 | 144 | $mid = ($floor + $ceiling) / 2; |
145 | - if ($bs[$i] == 1) |
|
146 | - $floor = $mid; |
|
147 | - else |
|
148 | - $ceiling = $mid; |
|
145 | + if ($bs[$i] == 1) { |
|
146 | + $floor = $mid; |
|
147 | + } else { |
|
148 | + $ceiling = $mid; |
|
149 | + } |
|
149 | 150 | } |
150 | 151 | return $mid; |
151 | 152 | } |
@@ -192,8 +193,9 @@ discard block |
||
192 | 193 | private function calcError(int $bits, float $floor, float $ceiling): float |
193 | 194 | { |
194 | 195 | $err = ($ceiling - $floor) / 2; |
195 | - while ($bits--) |
|
196 | - $err /= 2; |
|
196 | + while ($bits--) { |
|
197 | + $err /= 2; |
|
198 | + } |
|
197 | 199 | return $err; |
198 | 200 | } |
199 | 201 | } |
200 | 202 | \ No newline at end of file |