我尝试将一些PHP代码转换为C#。你能告诉我为什么会返回不同的值吗?
(1 << 56) | (1 << 52) | (1 << 32) | (97448965 << 1) | 1
PHP返回值:
76561198155163659
C#:
UInt64 s64 = (1 << 56) | (1 << 52) | (1 << 32) | (97448965 << 1) | 1;
//194897931
位移结果
Bit shift | C# | PHP
--------------|----------| -----------------
1 << 56 |16777216 | 72057594037927936
1 << 52 |1048576 | 4503599627370496
1 << 32 |1 | 4294967296
97448965 << 1 |194897930 | 194897930