- Small optimization in hwFloat
authorunc0rr
Thu, 08 May 2008 18:38:52 +0000
changeset 916 1d0022336fbb
parent 915 33040b7695c0
child 917 e59614bffc3f
- Small optimization in hwFloat - Debug message in rndSign to help discover cluster bomb issue
hedgewars/uFloat.pas
hedgewars/uMisc.pas
hedgewars/uRandom.pas
--- a/hedgewars/uFloat.pas	Thu May 08 18:02:52 2008 +0000
+++ b/hedgewars/uFloat.pas	Thu May 08 18:38:52 2008 +0000
@@ -230,7 +230,7 @@
 
 operator < (const z1, z2: hwFloat) b : boolean;
 begin
-if z1.isNegative <> z2.isNegative then
+if z1.isNegative xor z2.isNegative then
    b:= z1.isNegative
 else
    if z1.QWordValue = z2.QWordValue then
@@ -241,7 +241,7 @@
 
 operator > (const z1, z2: hwFloat) b : boolean;
 begin
-if z1.isNegative <> z2.isNegative then
+if z1.isNegative xor z2.isNegative then
    b:= z2.isNegative
 else
    if z1.QWordValue = z2.QWordValue then
--- a/hedgewars/uMisc.pas	Thu May 08 18:02:52 2008 +0000
+++ b/hedgewars/uMisc.pas	Thu May 08 18:38:52 2008 +0000
@@ -346,7 +346,7 @@
 {$I+}
 
 finalization
-uRandom.DumpBuffer;
+//uRandom.DumpBuffer;
 writeln(f, '-= halt at ',GameTicks,' ticks =-');
 Flush(f);
 close(f)
--- a/hedgewars/uRandom.pas	Thu May 08 18:02:52 2008 +0000
+++ b/hedgewars/uRandom.pas	Thu May 08 18:38:52 2008 +0000
@@ -82,6 +82,7 @@
 function rndSign(num: hwFloat): hwFloat;
 begin
 num.isNegative:= odd(GetNext);
+if num.isNegative then AddFileLog('isNegative TRUE') else AddFileLog('isNegative FALSE');
 rndSign:= num
 end;