hedgewars/uFloat.pas
changeset 953 237fc147950c
parent 916 1d0022336fbb
child 967 8be3938d73c2
--- a/hedgewars/uFloat.pas	Mon May 26 18:10:51 2008 +0000
+++ b/hedgewars/uFloat.pas	Mon May 26 20:41:12 2008 +0000
@@ -279,7 +279,7 @@
 begin
 hwSqr.isNegative:=false;
 hwSqr.QWordValue:= QWord(t.Round) * t.Frac * 2 + ((QWord(t.Frac) * t.Frac) shr 32);
-hwSqr.Round:= hwSqr.Round + QWord(t.Round) * t.Round
+hwSqr.Round:= hwSqr.Round + t.Round * t.Round
 end;
 
 function hwSqrt(const t: hwFloat): hwFloat;
@@ -295,7 +295,8 @@
    end else
    begin
    l:= $100000000;
-   r:= t.QWordValue div 2 + $80000000 // r:= t / 2 + 0.5 
+   r:= t.QWordValue div 2 + $80000000; // r:= t / 2 + 0.5
+   if r > $FFFFFFFFFFFF then r:= $FFFFFFFFFFFF
    end;
 
 repeat