 |
Leto GURU

Joined: 27 Sep 2000 Posts: 90 Location: USA
|
Posted: 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 |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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.
|
|
|
 |
|
|