
例如,上图的原因是
[En]
For example, the reason for the above picture is that
Python具有任意精度的整数
在执行按位运算时,JavaScript会将数字转换为32位整数。JavaScript为您提供了相同的Python结果,但被截断为32位。
[En]
When performing a bitwise operation, JavaScript converts a number to a 32-bit integer. JavaScript gives you the same Python result, but is truncated to 32 bits.
x =11122222<= 0x80000000:
x = -(0x100000000 - x)
print(x)
Original: https://www.cnblogs.com/pythonywy/p/15969186.html
Author: 小小咸鱼YwY
Title: python 数字位运算结果和js不一样
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/7477/
转载文章受原作者版权保护。转载请注明原作者出处!