function GPBWire::zigZagDecode64
1 call to GPBWire::zigZagDecode64()
- GPBWire::readSint64 in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ GPBWire.php
File
-
vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ GPBWire.php, line 130
Class
Namespace
Google\Protobuf\InternalCode
public static function zigZagDecode64($uint64) {
if (PHP_INT_SIZE == 4) {
if (bcmod($uint64, 2) == 0) {
return bcdiv($uint64, 2, 0);
}
else {
return bcsub(0, bcdiv(bcadd($uint64, 1), 2, 0));
}
}
else {
return $uint64 >> 1 & 0x7fffffffffffffff ^ -($uint64 & 1);
}
}