Einzelnen Beitrag anzeigen

Der schöne Günther

Registriert seit: 6. Mär 2013
6.110 Beiträge
 
Delphi 10 Seattle Enterprise
 
#1

EIntOverflow bei LongWord, nicht aber bei Word

  Alt 28. Mai 2018, 16:11
Delphi-Version: 5
Warum?

Delphi-Quellcode:
{$OVERFLOWCHECKS ON}

procedure acceptDouble(const input: Double);
begin
   //
end;

procedure p();
var
   a, b: Word;
   x, y: LongWord;
begin
   a := 1000;
   b := 10000;
   acceptDouble(a-b);

   x := 1000;
   y := 10000;
   acceptDouble(x-y); // << EIntOverflow
end;
  Mit Zitat antworten Zitat