Byte, Word, Cardinal handled in diffrent way than UInt64
Original Reporter info from Mantis: condi
-
Reporter name: Robert Jędrzejczyk
Original Reporter info from Mantis: condi
- Reporter name: Robert Jędrzejczyk
Description:
if a < b then I have different result
c := (a - b) shr 31; => c = 4294967295
and
c := (a - b);
c := c shr 31; => c = 1
The same results for Byte, Word types but not for UInt64 type.
Steps to reproduce:
program testCardinal;
var
a, b, c : Cardinal;
begin
a := 1;
b := 2;
c := (a - b) shr 31;
WriteLn(c); // 4294967295
c := (a - b);
c := c shr 31;
WriteLn(c); // 1
end.
program testUInt64;
var
a, b, c : UInt64;
begin
a := 1;
b := 2;
c := (a - b) shr 63;
WriteLn(c); // 1
c := (a - b);
c := c shr 63;
WriteLn(c); // 1
end.
Mantis conversion info:
- Mantis ID: 24312
- OS: Windows XP
- Version: 2.6.2