When I compiled the following simply programs using Lazarus 1.8 fpc 3.0.4 Win 64, run it, it will throws RunError(215) Arithmetic overflow error.

However, if I compile and run the same in Lazarus 1.8 fpc 3.0.4 win 32, it won't raise the RunError (215).
Why???


program test64bit;
{$mode objfpc}{$H+}
{$OVERFLOWCHECKS ON}
var
  LW1, LW2 : array[false..true] of LongWord;
  c : currency;
  aBoolean : Boolean;
begin
  LW1[false] := 5;
  LW1[true] := 5;

  LW2[false] := 10;
  LW2[true] := 10;
  c := 10;
  aBoolean :=  (LW1[true] + LW1[false]) - (LW2[false]+LW2[true]) > c ;
Writeln('if compiled in 64 bit, a RunError(215) will have occurred and it will not reach this line');
  readln;
end.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to