lua-users home
lua-l archive

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


Yep and that's what we did for now on BREW as well... We should be able
to use floats shortly though FP exceptions will still be messy 

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Daniel Collins
Sent: Sunday, February 26, 2006 6:12 PM
To: Lua list
Subject: Re: Integer patch for Lua 5.1 final

> I recall reading that the Lua mumeric type can be changed to 
> as little 
> as a 16 bit int and Lua still works.
<snip>

Yes, I have been looking at luaconf.h now, as well as searching through
the lua-list archives. I think that changing LUA_NUMBER to int (along
with the associated changes in luaconf.h) will work for now.

Fortunately the maths needs of the high level code for my project are
not great. Perhaps I wont need fixed point at all. If it turns out that
I need more precision I can sort that out later, perhaps by creating a
new userdata type, rather than by directly modifying the lua VM to use
fixed point. This means I wont be able to write:

	width = 10
	columnWidth = width / 3

and have the calculations done in fixed point, but I am happy to live
with this. In fact I cant use that kind of syntax with fixed point math
in C anyway (it is all done with macros), so having the Lua syntax
parallel the C syntax may be a good thing.

- Daniel collins