On 11/14/2012 6:05 AM, Roberto Ierusalimschy wrote:
One of the main reasons that Lua uses double is to support full 32
bits. With a natural 32-bit integer, you could compile Lua with single
floats and then really reduce memory usage. But the introduction of
integers also solve a big reverse problem. Frequently, restricted
systems compile Lua with longs as its number type. And frequently,
there is the problem of how to manipulate floating point numbers on
those systems. Lua with 32-bit integers and single floats would use
much less memory, offering full 32 bits when needed, the speed of
integers for hardware without FP support, and floating point number
when necessary. -- Roberto
This would be especially useful for embedded use, since there are many
recent 32-bit MCUs with hardware single precision floating point (but
not double precision), and plenty of memory to run eLua or other minimal
Lua systems.