|
|
||
|
Aaron Brown wrote:This is on Win32 (Lua is part of our game engine). We did not modify LUA_NUMBER. It's still double.Brian Weed wrote:
Is there something about adding numbers that I should know about?
print(0x10000000) 268435456
print(0x10000000 + 0x00000001) 268435456
print(0x10000000 + 0x00000002) 268435456
I get 268435456, 268435457, and 268435458. My first guess is that you're using (single-precision) floats instead of doubles. What platform are you on? Did you change LUA_NUMBER when compiling?
http://docs.sun.com/source/806-3568/ncg_goldberg.html
Lua is compiled as a static lib via Visual C++ 6.0. The app is compiled via Visual Studio 2005.
Brian
Ok, this is really weird...
double d = 0x10000000;
d = d + 0x00000002;
doubles are supposed to be able to completely represent a 32bit int right?
Brian