mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 21:33:54 -07:00
Power operator can be used
Signed-off-by: Yuriy Pikhtarev <iglix@me.com>
This commit is contained in:
parent
f0d6d30def
commit
4bb72dfe59
2 changed files with 2 additions and 2 deletions
|
@ -128,7 +128,7 @@ switch ($field) {
|
||||||
|
|
||||||
foreach (array('KB' => 1, 'MB' => 2, 'GB' => 3, 'TB' => 4) as $s => $m) {
|
foreach (array('KB' => 1, 'MB' => 2, 'GB' => 3, 'TB' => 4) as $s => $m) {
|
||||||
if (strpos($this->request['value'], $s) !== false) {
|
if (strpos($this->request['value'], $s) !== false) {
|
||||||
$value *= pow(1024, $m);
|
$value *= (1024 ** $m);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ function base64_unpack($string)
|
||||||
for ($i = 1; $i <= $length; $i++) {
|
for ($i = 1; $i <= $length; $i++) {
|
||||||
$pos = $length - $i;
|
$pos = $length - $i;
|
||||||
$operand = strpos($chars, $string[$pos]);
|
$operand = strpos($chars, $string[$pos]);
|
||||||
$exponent = pow($base, $i - 1);
|
$exponent = $base ** ($i - 1);
|
||||||
$decValue = $operand * $exponent;
|
$decValue = $operand * $exponent;
|
||||||
$number += $decValue;
|
$number += $decValue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue