hedgewars/uFloat.pas
changeset 8838 aa2ffd427f6a
parent 7715 8b653edac2a2
child 8847 ff7fbab7cd56
child 8905 82b1400f4a08
--- a/hedgewars/uFloat.pas	Wed Apr 03 00:46:19 2013 +0200
+++ b/hedgewars/uFloat.pas	Wed Apr 03 23:56:59 2013 +0200
@@ -63,9 +63,7 @@
 // The implemented operators
 
 operator = (const z1, z2: hwFloat) z : boolean; inline;
-{$IFDEF PAS2C}
-operator <> (const z1, z2: hwFloat) z : boolean; inline;
-{$ENDIF}
+
 operator + (const z1, z2: hwFloat) z : hwFloat; inline;
 operator - (const z1, z2: hwFloat) z : hwFloat; inline;
 operator - (const z1: hwFloat) z : hwFloat; inline;
@@ -221,19 +219,11 @@
     hwFloat2Float:= -hwFloat2Float;
 end;
 
-{$IFNDEF WEB}
 operator = (const z1, z2: hwFloat) z : boolean; inline;
 begin
     z:= (z1.isNegative = z2.isNegative) and (z1.QWordValue = z2.QWordValue);
 end;
 
-{$IFDEF PAS2C}
-operator <> (const z1, z2: hwFloat) z : boolean; inline;
-begin
-    z:= (z1.isNegative <> z2.isNegative) or (z1.QWordValue <> z2.QWordValue);
-end;
-{$ENDIF}
-
 operator + (const z1, z2: hwFloat) z : hwFloat; inline;
 begin
 if z1.isNegative = z2.isNegative then
@@ -300,102 +290,6 @@
     else
         b:= (z1.QWordValue > z2.QWordValue) <> z2.isNegative
 end;
-{$ENDIF}
-{$IFDEF WEB}
-(*
-    Mostly to be kind to JS as of 2012-08-27 where there is no int64/uint64.  This may change though.
-*)
-operator = (const z1, z2: hwFloat) z : boolean; inline;
-begin
-    z:= (z1.isNegative = z2.isNegative) and (z1.Frac = z2.Frac) and (z1.Round = z2.Round);
-end;
-
-operator <> (const z1, z2: hwFloat) z : boolean; inline;
-begin
-    z:= (z1.isNegative <> z2.isNegative) or (z1.Frac <> z2.Frac) or (z1.Round <> z2.Round);
-end;
-
-operator + (const z1, z2: hwFloat) z : hwFloat; inline;
-begin
-if z1.isNegative = z2.isNegative then
-    begin
-    z:= z1;
-    z.Frac:= z.Frac + z2.Frac;
-    z.Round:= z.Round + z2.Round;
-    if z.Frac<z1.Frac then inc(z.Round)
-    end
-else
-    if (z1.Round > z2.Round) or ((z1.Round = z2.Round) and (z1.Frac > z2.Frac)) then
-        begin
-        z.isNegative:= z1.isNegative;
-        z.Round:= z1.Round - z2.Round;
-        z.Frac:= z1.Frac - z2.Frac;
-        if z2.Frac > z1.Frac then dec(z.Round)
-        end
-    else
-        begin
-        z.isNegative:= z2.isNegative;
-        z.Round:= z2.Round - z1.Round;
-        z.Frac:= z2.Frac-z1.Frac;
-        if z2.Frac < z1.Frac then dec(z.Round)
-        end
-end;
-
-operator - (const z1, z2: hwFloat) z : hwFloat; inline;
-begin
-if z1.isNegative = z2.isNegative then
-    if (z1.Round > z2.Round) or ((z1.Round = z2.Round) and (z1.Frac > z2.Frac)) then
-        begin
-        z.isNegative:= z1.isNegative;
-        z.Round:= z1.Round - z2.Round;
-        z.Frac:= z1.Frac-z2.Frac;
-        if z2.Frac > z1.Frac then dec(z.Round)
-        end
-    else
-        begin
-        z.isNegative:= not z2.isNegative;
-        z.Round:= z2.Round - z1.Round;
-        z.Frac:= z2.Frac-z1.Frac;
-        if z2.Frac < z1.Frac then dec(z.Round)
-        end
-else
-    begin
-    z:= z1;
-    z.Frac:= z.Frac + z2.Frac;
-    z.Round:= z.Round + z2.Round;
-    if z.Frac<z1.Frac then inc(z.Round)
-    end
-end;
-
-operator < (const z1, z2: hwFloat) b : boolean; inline;
-begin
-if z1.isNegative xor z2.isNegative then
-    b:= z1.isNegative
-else
-(*  Not so sure this specialcase is a win w/ Round/Frac. have to do more tests anyway.
-    if (z1.Round = z2.Round and (z1.Frac = z2.Frac)) then
-        b:= false
-    else *)
-        b:= ((z1.Round < z2.Round) or ((z1.Round = z2.Round) and (z1.Frac < z2.Frac))) <> z1.isNegative
-end;
-
-operator > (const z1, z2: hwFloat) b : boolean; inline;
-begin
-if z1.isNegative xor z2.isNegative then
-    b:= z2.isNegative
-else
-(*
-    if z1.QWordValue = z2.QWordValue then
-        b:= false
-    else*)
-        b:= ((z1.Round > z2.Round) or ((z1.Round = z2.Round) and (z1.Frac > z2.Frac))) <> z1.isNegative
-end;
-
-function isZero(const z: hwFloat): boolean; inline; 
-begin
-isZero := (z.Round = 0) and (z.Frac = 0);
-end;
-{$ENDIF}
 
 operator - (const z1: hwFloat) z : hwFloat; inline;
 begin