Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
ondrovic
Beginner


Joined: 22 Feb 2002
Posts: 25
Location: USA

PostPosted: 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
Reply with quote
ondrovic
Beginner


Joined: 22 Feb 2002
Posts: 25
Location: USA

PostPosted: 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
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: 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.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: 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
Reply with quote
ondrovic
Beginner


Joined: 22 Feb 2002
Posts: 25
Location: USA

PostPosted: Wed Mar 13, 2002 2:38 pm   
 
thank you all for you help again i would be lost without you people

CHRIS ONDROVIC
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net