Bit shift operations on QWord again
Original Reporter info from Mantis: Blaazen @Blaazen
-
Reporter name: Vojtech Cihak
Original Reporter info from Mantis: Blaazen @Blaazen
- Reporter name: Vojtech Cihak
Description:
Bitshift operation (shl) on QWord variable is broken when exceed (1 shl 31).
Steps to reproduce:
Use QWord variable !
1 shl 31 = 1073741824 works prefectly
1 shl 32 =-2147483648 wrong! (unexpexted overflow?)
1 shl 33 = 1 wrong!
1 shl 34 = 2 and everything above is completly wrong!
231 = 1073741824 works prefectly
232 = 2147483648 works prefectly
2**33 = 4294967296 works prefectly
Additional information:
1) I found this: http://bugs.freepascal.org/view.php?id=10545
but it seems it is not my case because I have 64-bit compiler and 64-bit
variables.
- IntToStr was used to output for both (1 shl x) and (2**x) I believe it is OK.
Mantis conversion info:
- Mantis ID: 18685
- OS: Linux
- OS Build: Kubuntu 10.10 am
- Build: SVN from 31.Jan.2011
- Platform: amd64
- Version: 2.5.1