hedgewars/uFloat.pas
changeset 5843 8c5168e3194c
parent 5832 f730c8a9777b
child 5932 5164d17b6374
child 6295 5b2b304a91ec
equal deleted inserted replaced
5842:30e374a27269 5843:8c5168e3194c
    13  *
    13  *
    14  * You should have received a copy of the GNU General Public License
    14  * You should have received a copy of the GNU General Public License
    15  * along with this program; if not, write to the Free Software
    15  * along with this program; if not, write to the Free Software
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    17  *)
    17  *)
       
    18 
       
    19 {$INCLUDE "options.inc"}
    18 
    20 
    19 unit uFloat;
    21 unit uFloat;
    20 (*
    22 (*
    21  * This unit provides a custom data type, hwFloat.
    23  * This unit provides a custom data type, hwFloat.
    22  *
    24  *
    77 
    79 
    78 function cstr(const z: hwFloat): shortstring; // Returns a shortstring representations of the hwFloat.
    80 function cstr(const z: hwFloat): shortstring; // Returns a shortstring representations of the hwFloat.
    79 function hwRound(const t: hwFloat): LongInt; inline; // Does NOT really round but returns the integer representation of the hwFloat without fractional digits. (-_0_9 -> -0, _1_5 -> _1)
    81 function hwRound(const t: hwFloat): LongInt; inline; // Does NOT really round but returns the integer representation of the hwFloat without fractional digits. (-_0_9 -> -0, _1_5 -> _1)
    80 function hwAbs(const t: hwFloat): hwFloat; inline; // Returns the value of t with positive sign.
    82 function hwAbs(const t: hwFloat): hwFloat; inline; // Returns the value of t with positive sign.
    81 function hwSqr(const t: hwFloat): hwFloat; inline; // Returns the square value of parameter t.
    83 function hwSqr(const t: hwFloat): hwFloat; inline; // Returns the square value of parameter t.
    82 function hwSqrt(const t: hwFloat): hwFloat; // Returns the the positive square root of parameter t.
    84 function hwSqrt(const t: hwFloat): hwFloat; inline; // Returns the the positive square root of parameter t.
    83 function Distance(const dx, dy: hwFloat): hwFloat; // Returns the distance between two points in 2-dimensional space, of which the parameters are the horizontal and vertical distance.
    85 function Distance(const dx, dy: hwFloat): hwFloat; // Returns the distance between two points in 2-dimensional space, of which the parameters are the horizontal and vertical distance.
    84 function DistanceI(const dx, dy: LongInt): hwFloat; // Same as above for integer parameters.
    86 function DistanceI(const dx, dy: LongInt): hwFloat; // Same as above for integer parameters.
    85 function AngleSin(const Angle: Longword): hwFloat;
    87 function AngleSin(const Angle: Longword): hwFloat;
    86 function AngleCos(const Angle: Longword): hwFloat;
    88 function AngleCos(const Angle: Longword): hwFloat;
    87 function SignAs(const num, signum: hwFloat): hwFloat; inline; // Returns an hwFloat with the value of parameter num and the sign of signum.
    89 function SignAs(const num, signum: hwFloat): hwFloat; inline; // Returns an hwFloat with the value of parameter num and the sign of signum.