[fpc-pascal]QWORD error ?

Lubomir.Cabla at cssz.cz Lubomir.Cabla at cssz.cz
Mon Apr 5 12:12:06 CEST 2004


Hi All,

I'm sorry, but i'm having trouble using 64-bits QWORD arithmetic.
This results i got with IDE 0.9.2 5.4.2004, compiler 1.9.3.

var L : Longint;
    qw : qword;
begin
  qw:=100;
  qw:=qw-1;                   { qw=99 O.K. }
  L:=1;
  qw:=qw-L;                   { qw=98 O.K. }
  L:=-1;
  qw:=qw+(-L);                { qw=99 O.K. }
(*
  qw:=qw-L;                   { run time error 201 }
  qw:=qw+L;                   { run time error 201 }
*)
  qw:=qw+int64(L);            { qw=98 O.K. }
  L:=1;
  qw:=qw+int64(-L);           { qw=4294697393 O.K. ? }
  qw:=qw+int64(-1);           { qw=4294697392 O.K. ? }
(*
  qw:=qw+(-1);                { range check error while evaluating constants
}
*)
end.

Could somebody help me what's wrong ?
Many thanks for your useful help.

Lubomir Cabla/CBL




More information about the fpc-pascal mailing list