hedgewars/uFloat.pas
changeset 6879 f44042ba755c
parent 6785 a8aa5984185f
child 7042 de20086a6bcc
equal deleted inserted replaced
6878:0af34406b83d 6879:f44042ba755c
    88 function DistanceI(const dx, dy: LongInt): hwFloat; // Same as above for integer parameters.
    88 function DistanceI(const dx, dy: LongInt): hwFloat; // Same as above for integer parameters.
    89 function AngleSin(const Angle: Longword): hwFloat;
    89 function AngleSin(const Angle: Longword): hwFloat;
    90 function AngleCos(const Angle: Longword): hwFloat;
    90 function AngleCos(const Angle: Longword): hwFloat;
    91 function SignAs(const num, signum: hwFloat): hwFloat; inline; // Returns an hwFloat with the value of parameter num and the sign of signum.
    91 function SignAs(const num, signum: hwFloat): hwFloat; inline; // Returns an hwFloat with the value of parameter num and the sign of signum.
    92 function hwSign(r: hwFloat): LongInt; inline; // Returns an integer with value 1 and sign of parameter r.
    92 function hwSign(r: hwFloat): LongInt; inline; // Returns an integer with value 1 and sign of parameter r.
    93 function hwSign(r: real): LongInt; inline; // Returns an integer with value 1 and sign of parameter r.
    93 function hwSignf(r: real): LongInt; inline; // Returns an integer with value 1 and sign of parameter r.
    94 function isZero(const z: hwFloat): boolean; inline;
    94 function isZero(const z: hwFloat): boolean; inline;
    95 {$IFDEF FPC}
    95 {$IFDEF FPC}
    96 {$J-}
    96 {$J-}
    97 {$ENDIF}
    97 {$ENDIF}
    98 {$WARNINGS OFF}
    98 {$WARNINGS OFF}
   422     hwSign:= -1
   422     hwSign:= -1
   423 else
   423 else
   424     hwSign:= 1
   424     hwSign:= 1
   425 end;
   425 end;
   426 
   426 
   427 function hwSign(r: real): LongInt;
   427 function hwSignf(r: real): LongInt;
   428 begin
   428 begin
   429 if r < 0 then
   429 if r < 0 then
   430     hwSign:= -1
   430     hwSignf:= -1
   431 else
   431 else
   432     hwSign:= 1
   432     hwSignf:= 1
   433 end;
   433 end;
   434 
   434 
   435 
   435 
   436 function AngleSin(const Angle: Longword): hwFloat;
   436 function AngleSin(const Angle: Longword): hwFloat;
   437 begin
   437 begin