|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Thu Jan 07, 2010 10:42 pm
[3.12] 64-bit integer support bug |
As I recall, CMUD is capable of displaying 64-bit integers. This doesn't seem to be the case with zscript.
#SAY (100000 * 30000) returns -1294967296
However, if you do the same thing in Lua:
print(100000*30000) returns, correctly, 3000000000.
It seems that zscript cannot support 64-bit integers, though I'm not sure when that has become a problem.
Charneus |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Jan 08, 2010 5:36 pm |
Hmm, I'll look into that. CMUD 2.37 does the same thing. CMUD is supposed to be using 64-bit integers for internal calculations, but might only be able to store 32-bit. But I just tried this:
#SAY ((100000 * 30000)/1000)
and it still didn't work. So somehow it's not even using 64-bit for internal calculations. |
|
|
|
wrym Magician
Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
|
Posted: Mon Jan 11, 2010 5:23 pm |
hmm, I think this has more to do with expression parsing Zugg. I do have a variable that is currently well into 64-bit integer range.
additionally
#SAY (100000 * (30000))
#SAY ((100000) * 30000)
#SAY (100000 * %int(30000))
All seem to work correctly |
|
_________________ "To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle |
|
|
|
|
|