Power operator can be used.

This commit is contained in:
Yuriy Pikhtarev 2017-05-05 00:59:39 +03:00
commit b43b0d359d
No known key found for this signature in database
GPG key ID: 3A9B5A757B48ECC6
2 changed files with 2 additions and 2 deletions

View file

@ -146,7 +146,7 @@ switch ($field) {
foreach (array('KB' => 1, 'MB' => 2, 'GB' => 3, 'TB' => 4) as $s => $m) {
if (strpos($this->request['value'], $s) !== false) {
$value *= pow(1024, $m);
$value *= 1024 ** $m;
break;
}
}

View file

@ -84,7 +84,7 @@ function base64_unpack($string)
for ($i = 1; $i <= $length; $i++) {
$pos = $length - $i;
$operand = strpos($chars, substr($string, $pos, 1));
$exponent = pow($base, $i - 1);
$exponent = $base ** ($i - 1);
$decValue = $operand * $exponent;
$number += $decValue;
}