lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I recently downloaded Lua 5.0 alpha and am trying to convert the code 
to use floats instead of doubles. Here's what I did:

1) in lua.h, changed LUA_NUMBER from double to float
2) in llimits.h, changed LUSER_ALIGNMENT_T from double to float

When I tried to compile this under MS Dev Studio, I got a bunch of 
warnings, mostly about implicit casts from int to float. This makes 
sense since 32-bit floats don't have enough precision to store large 
32-bit integer values.

Now, assuming that the application I'm using Lua for won't be using 
particularly large integer values for variables, is it safe to simply 
insert explicit type casts to get rid of the compiler warnings? Or 
will there still be problems with internal values that are passed 
around that could have large values, like pointer values?