Skip to content

SHR (and probably SHL) behavior inconsistense

Original Reporter info from Mantis: Maxim @ganmax
  • Reporter name: Maxim Ganetsky

Description:

The following program

program shrshl;
var
  i: integer;
begin
  i := 55;
  WriteLn(55 shr 32);
  WriteLn(i shr 32);
end.

gives the following output:

0
55

I would expect consistent result in this case.

Additional information:

FPC 2.6.2 win32.

Mantis conversion info:

  • Mantis ID: 24815
  • OS: Windows
  • OS Build: XP SP3
  • Platform: Win32
  • Version: 2.6.2
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information