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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Leto
GURU


Joined: 27 Sep 2000
Posts: 90
Location: USA

PostPosted: Mon Jan 14, 2008 11:24 pm   

[2.18 Pro] Issues with large numbers and expansion
 
cMud 2.18 Pro seems to bork when handling large numbers in math operations that require any expansion.


Use this alias:
Code:
$n=1000000000000000000
$d=2
#SHOW "*Begin Test"
//  A & B shows that %eval() can handle large numbers
#SHOW "A: "%eval(1000000000000000000)
#SHOW "B: "%int(1000000000000000000)
//  C & D shows that %eval() and %int() can handle large numbers
// while doing math
#SHOW "C: "%eval(1000000000000000000/2)
#SHOW "D: "%int(1000000000000000000/2)
// Handling any expansion seems to cause large numbers to fail
#SHOW "E: "%eval(1000000000000000000/%int(2))
#SHOW "F: "%eval(%int(1000000000000000000)/%int(2))
#SHOW "G: "%eval(%int(1000000000000000000)/2)
#SHOW "H: "%eval($n/$d)
#SHOW "I: "%eval(1000000000000000000/$d)
#SHOW "J: "%eval($n/2)
#SHOW "K: "%eval((1000000000000000000)/(2))
$t=1000000000000000000/2
#SHOW "M: "$t
$t=$n/$d
#SHOW "L: "$t
#SHOW "*End Test"

The alias will produce this output:
Code:
*Begin Test
A: 1000000000000000000
B: 1000000000000000000
C: 500000000000000000
D: 500000000000000000
E: -743309312
F: -743309312
G: -743309312
H: -743309312
I: -743309312
J: -743309312
K: -743309312
M: 500000000000000000
L: -743309312
*End Test
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Jan 15, 2008 6:40 pm   
 
Thanks for the test script. I'll try to use that in future testing to improve some of the math routines.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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