bitshift operations are not handled properly for LongInt
Original Reporter info from Mantis: sonicode
-
Reporter name: Bad Guy
Original Reporter info from Mantis: sonicode
- Reporter name: Bad Guy
Description:
When used on "integer" or "shortint" variables, SHR and SHL operates as expected: perform arhithmetic shifting with MSB duplication/stuffing that is required for negative number handling.
However when variable is defined as "longint" - operation result is wrong due to some strange 31-bit wraparound.
Added a small program to verify problem.
Additional information:
Noiced when dug up old signal processing code, that worked fine on turbo pascal (back in the days).
Mantis conversion info:
- Mantis ID: 10545
- Version: 2.2.0