天天看點

python 數字位運算結果和js不一樣

python 數字位運算結果和js不一樣

例如上圖的情況原因是

Python具有任意精度的整數

x =11122222<<8
if x >= 0x80000000:
    x = -(0x100000000 - x)
print(x)