[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: print(268435456 + 1)
- From: "Leo Razoumov" <slonik.az@...>
- Date: Fri, 1 Sep 2006 12:07:12 -0400
On 9/1/06, Brian Weed <firstname.lastname@example.org> wrote:
Aaron Brown wrote:
> Brian Weed wrote:
>> Is there something about adding numbers that I should know
>> print(0x10000000 + 0x00000001)
>> print(0x10000000 + 0x00000002)
> 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?
This is on Win32 (Lua is part of our game engine). We did not modify
LUA_NUMBER. It's still double.
Lua is compiled as a static lib via Visual C++ 6.0. The app is compiled
via Visual Studio 2005.
I do not see any problems on Intel x86 (32bits) Linux 2.6.13 with Lua
5.1.1, double Lua numbers
print( 268435456 + 1 )
print( 268435456 + 2 )
print( 268435456 + 3 )
Your problem is clearly platform specific. First compile vanila
standalone Lua-5.1.1 without game engine and try to see whether the
Hope is helps!