|
ondrovic Beginner
Joined: 22 Feb 2002 Posts: 25 Location: USA
|
Posted: Wed Mar 13, 2002 6:55 am
decimals |
in mudmaseter calldll the mathdll are used for this
This dll allows floating point math (decimals) with the basic math functions add,sub,mul,div, and comparision. /calldll {Math} {Help} for info. New in 4.0: PowerOf, SquareRoot functions. And 3 bitwise operations: BitAnd, BitOr, and BitNot
I was wonder what zmud used for this
CHRIS ONDROVIC |
|
|
|
ondrovic Beginner
Joined: 22 Feb 2002 Posts: 25 Location: USA
|
Posted: Wed Mar 13, 2002 6:57 am |
this is part of the script
{$xpttl $xpcount xphour};#calldll math.dll {Mul} {$xphour 3600 xphour};#calldll math.dll {Div} {$xpmin
CHRIS ONDROVIC |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Wed Mar 13, 2002 12:38 pm |
It might be possible to use the math.dll you mentioned if it has a COM interface. However the amount of effort required to get it working would exceed the small amount of patience required to wait for the next public version. Which has improvement to floating point numbers.
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Wed Mar 13, 2002 1:32 pm |
Like Vijilante said, the next version of zMUD has support for floating point numbers. As for the bitwise operations, you can use the following functions:
%bitand
%bitor
%bitxor
%bitnot
Kjata |
|
|
|
ondrovic Beginner
Joined: 22 Feb 2002 Posts: 25 Location: USA
|
Posted: Wed Mar 13, 2002 2:38 pm |
thank you all for you help again i would be lost without you people
CHRIS ONDROVIC |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Mar 13, 2002 3:48 pm |
For the moment, if you really need additional precision:
Do your division, this provides the integer portion
Multiply by 10 to the number of decimal places wanted
Do your division
Modular divide by 10 to the number of decimal places wanted
This is the decimal portion
Concatenate the integer portion, a decimal point, and the decimal portion
Example: 13/6 to 2 decimal places
13/6 = 2
13*(10^2) = 1300
1300/6 = 216
216(10^2) = 16
Concatenating 2, ., and 16 = 2.16
LightBulb
All scripts untested unless otherwise noted |
|
|
|
|
|