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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Ralph1971
Wanderer


Joined: 01 Mar 2008
Posts: 64

PostPosted: Sat Apr 23, 2011 11:43 am   

math and decimals
 
Trying to find averages, and multiply them correctly..
currently, (read in as variables):

curhp=90
curlevel=11
#math curavg(@curhp/@curlevel) returns 8
#math projectedhp(@curavg*50) returns 400
I need the curavg to reflect a more accurate 8.18 (in this case) so the projectedhp reflects a more accurate 409.
I've tried to play with %float and %format.. but kinda flustered..
_________________
Win7-home - Cmud 3.33a
WinXP-pro - Zmud 7.21
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Sat Apr 23, 2011 1:47 pm   
 
you need to make one of the numbers be decimal (even just .0) for it to perform float math

curavg=(%float(@curhp)/@curlevel)
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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