hedgewars/uFloat.pas
changeset 4374 bcefeeabaa33
parent 3929 9a4bbc1f67a2
child 4415 941251bad467
equal deleted inserted replaced
4373:fe0e3903bb9e 4374:bcefeeabaa33
    60 function Distance(const dx, dy: hwFloat): hwFloat;
    60 function Distance(const dx, dy: hwFloat): hwFloat;
    61 function DistanceI(const dx, dy: LongInt): hwFloat;
    61 function DistanceI(const dx, dy: LongInt): hwFloat;
    62 function AngleSin(const Angle: Longword): hwFloat;
    62 function AngleSin(const Angle: Longword): hwFloat;
    63 function AngleCos(const Angle: Longword): hwFloat;
    63 function AngleCos(const Angle: Longword): hwFloat;
    64 function SignAs(const num, signum: hwFloat): hwFloat; inline;
    64 function SignAs(const num, signum: hwFloat): hwFloat; inline;
       
    65 function hwSign(r: hwFloat): LongInt; inline;
    65 
    66 
    66 {$IFDEF FPC}
    67 {$IFDEF FPC}
    67 {$J-}
    68 {$J-}
    68 {$ENDIF}
    69 {$ENDIF}
    69 {$WARNINGS OFF}
    70 {$WARNINGS OFF}
   340 begin
   341 begin
   341 SignAs.QWordValue:= num.QWordValue;
   342 SignAs.QWordValue:= num.QWordValue;
   342 SignAs.isNegative:= signum.isNegative
   343 SignAs.isNegative:= signum.isNegative
   343 end;
   344 end;
   344 
   345 
       
   346 function hwSign(r: hwFloat): LongInt;
       
   347 begin
       
   348 // yes, we have negative zero for a reason
       
   349 if r.isNegative then hwSign:= -1 else hwSign:= 1
       
   350 end;
       
   351 
   345 {$INCLUDE "SinTable.inc"}
   352 {$INCLUDE "SinTable.inc"}
   346 
   353 
   347 function AngleSin(const Angle: Longword): hwFloat;
   354 function AngleSin(const Angle: Longword): hwFloat;
   348 begin
   355 begin
   349 {$IFDEF DEBUGFILE}
   356 {$IFDEF DEBUGFILE}