hedgewars/uFloat.pas
changeset 4374 bcefeeabaa33
parent 3929 9a4bbc1f67a2
child 4415 941251bad467
--- a/hedgewars/uFloat.pas	Thu Nov 18 09:12:27 2010 +0300
+++ b/hedgewars/uFloat.pas	Thu Nov 18 11:32:47 2010 +0300
@@ -62,6 +62,7 @@
 function AngleSin(const Angle: Longword): hwFloat;
 function AngleCos(const Angle: Longword): hwFloat;
 function SignAs(const num, signum: hwFloat): hwFloat; inline;
+function hwSign(r: hwFloat): LongInt; inline;
 
 {$IFDEF FPC}
 {$J-}
@@ -342,6 +343,12 @@
 SignAs.isNegative:= signum.isNegative
 end;
 
+function hwSign(r: hwFloat): LongInt;
+begin
+// yes, we have negative zero for a reason
+if r.isNegative then hwSign:= -1 else hwSign:= 1
+end;
+
 {$INCLUDE "SinTable.inc"}
 
 function AngleSin(const Angle: Longword): hwFloat;