lua-users home
lua-l archive

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


I'm using Lua 4.0 on a platform that implements only float in hardware -- double is emulated in software -- and I would like to remove all reference to double in the code and the API.

I've already defined LUA_NUM_TYPE as float, but there are plenty of doubles that this leaves behind.  I've defined a lua_Number type and replaced all remaining doubles with this (I know there's already a Number type, but wanted the "lua_" in front for the API defs).

My question: Is this safe?  I get compiler warnings about casting int to float.  These are in ltable.c and lvm.c.  Does anyone familiar with these files know what will happen if ints are not represented precisely by the floats?

Thanks.

Martin.