Thema: FreePascal Nicht nachvollziehbares NaN

Einzelnen Beitrag anzeigen

Benutzerbild von implementation
implementation

Registriert seit: 5. Mai 2008
940 Beiträge
 
FreePascal / Lazarus
 
#1

Nicht nachvollziehbares NaN

  Alt 21. Feb 2012, 15:29
Delphi-Version: 5
Hallo liebe Forengenossen,

irgendwie bin ich heute blind. An folgender Stelle bekomme ich immer NaN raus und finde meinen Fehler nicht

Delphi-Quellcode:
procedure SummonScreenfill(const callback: TStatPointEvent; const iter: TIteration; const col: TIterColorization; const w: complex; const x1,x2,y1,y2: double);
var x,y: word; itc: byte; fix: complex; at: complex;
begin
  for y := 0 to 479 do
    for x := 0 to 639 do begin
      at.r := x*((x2-x1)/640)+x1;
      if ((x2-x1))=nan then Writeln('oops =(');
      at.i := y*((y2-y1)/480)+y1;
      if at.i=nan then Writeln(':(');
      fix := iter(at,w,itc);
      callback(x,y,col(itc,fix));
    end;
end;
Laut Writeln sind x1=-1 und x2=1 (sowie y1=-1, y2=1). Demnach müsste x2-x1 doch =2 sein, oder erliege ich da einer geistigen Umnachtung? Aber nein, es werden immer brav 'oops =(' und '' ausgegeben.
Was mache ich falsch?
  Mit Zitat antworten Zitat