echo 83661<<15;//32 System results: 1553563648
echo 83661<<15;//64 System results: 2741403648
Want to keep 32 overflow result in 64-bit system, ask how to do, little brother think not understand, ask you big.
Reply to discussion (solution)
$n = 83661<<15;printf ("Signed:%d unsigned:%u binary:%032b", $n, $n, $n);
Signed:-1553563648 unsigned: 27,414,036,482 binary: 10100011011001101000000000000000
$n = 83661<<15;printf ("Signed:%d unsigned:%u binary:%032b", $n, $n, $n);
Signed:-1553563648 unsigned: 27,414,036,482 binary: 10100011011001101000000000000000
Big Hello, in 64 the machine carried out under.
$n = 83661<<15;printf ("%d", $n);//The result is still 2741403648.
Don't you get it?
They're one thing.
Don't you get it?
They're one thing.
Big, can pass
$n = 83661<<15;
Get this value on a 64-bit machine: 1553563648
echo 2741403648-0x100000000;
-1553563648
echo 2741403648-0x100000000;
-1553563648
Thank you greatly, my problem solved.
Displacement problem is not very familiar, we have to cram this knowledge.