mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Added GMP base
This commit is contained in:
parent
b3db08a370
commit
20e6d19d85
1 changed files with 3 additions and 3 deletions
|
|
@ -526,10 +526,10 @@ class Utils extends Thread{
|
|||
}
|
||||
|
||||
public static function readLong($str){
|
||||
$n = gmp_init(Utils::strToHex($str));
|
||||
if(gmp_testbit($n, 63)){
|
||||
$n = gmp_init(Utils::strToHex($str), 16);
|
||||
if(gmp_testbit($n, "63")){
|
||||
$n = gmp_xor($n, "0xffffffffffffffff"); //flip the bits
|
||||
$n = gmp_neg(gmp_add($n, 1)); // add one and negate
|
||||
$n = gmp_neg(gmp_add($n, "1")); // add one and negate
|
||||
}
|
||||
return gmp_strval($n);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue