hedgewars/uFloat.pas
changeset 6775 22b5fb7217db
parent 6700 e04da46ee43c
child 6785 a8aa5984185f
--- a/hedgewars/uFloat.pas	Sun Mar 11 23:24:09 2012 -0400
+++ b/hedgewars/uFloat.pas	Mon Mar 12 01:00:17 2012 -0400
@@ -89,6 +89,7 @@
 function AngleCos(const Angle: Longword): hwFloat;
 function SignAs(const num, signum: hwFloat): hwFloat; inline; // Returns an hwFloat with the value of parameter num and the sign of signum.
 function hwSign(r: hwFloat): LongInt; inline; // Returns an integer with value 1 and sign of parameter r.
+function hwSign(r: real): LongInt; inline; // Returns an integer with value 1 and sign of parameter r.
 function isZero(const z: hwFloat): boolean; inline;
 {$IFDEF FPC}
 {$J-}
@@ -409,6 +410,14 @@
     hwSign:= 1
 end;
 
+function hwSign(r: real): LongInt;
+begin
+if r < 0 then
+    hwSign:= -1
+else
+    hwSign:= 1
+end;
+
 
 function AngleSin(const Angle: Longword): hwFloat;
 begin