lua-users home
lua-l archive

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


> Does there exist a version of Lua 2.5 suitably modified to use double-precision floats?

No, but the hack below complies and seems to work fine on bisect.lua.
You probably need to change some more floats to double just to be sure.
In particular, check parser.c. If you need to load precompiled chunks,
then undump.c will require some work. If you need to precompile chunks,
so will dump.c. Actually, I think all those floats should be real, as
defined in types.h.

If you need help, please ask.
--lhf

diff -r lua-2.5/include/lua.h lua-2.5-double/include/lua.h
63c63
< float          lua_getnumber 		(lua_Object object);
---
> double          lua_getnumber 		(lua_Object object);
69c69
< void           lua_pushnumber 		(float n);
---
> void           lua_pushnumber 		(double n);
diff -r lua-2.5/src/types.h lua-2.5-double/src/types.h
12c12
< #define real float
---
> #define real double