lua-users home
lua-l archive

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

> Can't you do without float and only int ?
> If you can't, I guess you'll have to duplicate a fair amount 
> of code to
> deal with both types at a time, as I guess runtime conversion from one
> type to the other is not an option, as is already between numbers and
> strings.

Unfortunately, I need both.  Integers and floats are both used extensively
for the API, for things like 3D vectors and some basic physics calculations.
Integers are used for material identifiers and screen coordinates for HUD
graphics.  Those are just examples, there are many more uses for both types.
For the moment Lua is using floats all the time and I convert these to
integers in the Lua stub functions - something that is not really ideal.

I think that I will have to take the plunge and duplicate the code for
Numbers to add Integers.  What I am wondering is if there are any gotchas to
be aware of whilst doing this.  For example, coercion problems or stuff like

Mark Allen