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"} |
|
20 |
18 |
21 unit uFloat; |
19 unit uFloat; |
22 (* |
20 (* |
23 * This unit provides a custom data type, hwFloat. |
21 * This unit provides a custom data type, hwFloat. |
24 * |
22 * |
79 |
77 |
80 function cstr(const z: hwFloat): shortstring; // Returns a shortstring representations of the hwFloat. |
78 function cstr(const z: hwFloat): shortstring; // Returns a shortstring representations of the hwFloat. |
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) |
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) |
82 function hwAbs(const t: hwFloat): hwFloat; inline; // Returns the value of t with positive sign. |
80 function hwAbs(const t: hwFloat): hwFloat; inline; // Returns the value of t with positive sign. |
83 function hwSqr(const t: hwFloat): hwFloat; inline; // Returns the square value of parameter t. |
81 function hwSqr(const t: hwFloat): hwFloat; inline; // Returns the square value of parameter t. |
84 function hwSqrt(const t: hwFloat): hwFloat; inline; // Returns the the positive square root of parameter t. |
82 function hwSqrt(const t: hwFloat): hwFloat; // Returns the the positive square root of parameter t. |
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. |
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. |
86 function DistanceI(const dx, dy: LongInt): hwFloat; // Same as above for integer parameters. |
84 function DistanceI(const dx, dy: LongInt): hwFloat; // Same as above for integer parameters. |
87 function AngleSin(const Angle: Longword): hwFloat; |
85 function AngleSin(const Angle: Longword): hwFloat; |
88 function AngleCos(const Angle: Longword): hwFloat; |
86 function AngleCos(const Angle: Longword): hwFloat; |
89 function SignAs(const num, signum: hwFloat): hwFloat; inline; // Returns an hwFloat with the value of parameter num and the sign of signum. |
87 function SignAs(const num, signum: hwFloat): hwFloat; inline; // Returns an hwFloat with the value of parameter num and the sign of signum. |