Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi "Invalid floating point operation" bei einer Addition (https://www.delphipraxis.net/74269-invalid-floating-point-operation-bei-einer-addition.html)

xZise 31. Jul 2006 17:26


"Invalid floating point operation" bei einer Addit
 
Zitat:

---------------------------
Debugger Exception Notification
---------------------------
Project DOND.exe raised exception class EInvalidOp with message 'Invalid floating point operation'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
Diesen Hübschen Text bekomme ich, wenn ich folgende Operation durchführe:
Delphi-Quellcode:
BankAngebot : Integer;
{...}
var
  lowtotal, hightotal: real;
{...}
BankAngebot := round(lowtotal+hightotal);
Das passiert immer beim 2. Mal (bisher... weiter konnte ich nicht spielen) und lowtotal und hightotal können variieren.

Namenloser 31. Jul 2006 17:30

Re: "Invalid floating point operation" bei einer A
 
So ins Blaue geraten: Nimm statt Real Double.

Hawkeye219 31. Jul 2006 17:32

Re: "Invalid floating point operation" bei einer A
 
Hallo Fabian,

spontan fallen mir 2 mögliche Gründe für die Fehlermeldung ein: entweder sind die (lokalen?) Variablen nicht initialisiert, oder die Summe der beiden Real-Werte verläßt den Integer-Wertebereich.

Gruß Hawkeye

xZise 31. Jul 2006 17:32

Re: "Invalid floating point operation" bei einer A
 
Shice :(

Es war ein rechnefehler meinerseits, weil l war NaN und die beiden werte war

X * l und deshlab hats gekracht! Und sry, eigentlich sollte das nicht geschrieben werden :(

(@ Hawk: ersteres ;) )


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:31 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz