[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: embedded system - no double
- From: "Kevin Baca" <lualist@...>
- Date: Thu, 9 Sep 2004 12:37:54 -0700
Instead of typedefing lua_Number you should #define the following:
#define LUA_NUMBER int
#define LUA_INTEGER int
#define LUA_NUMBER_SCAN "%d"
#define LUA_NUMBER_FMT "%d"
Make sure these are globally accessible.
In my case I #define them in lua.h.
> -----Original Message-----
> From: firstname.lastname@example.org
> [mailto:email@example.com] On Behalf Of
> daniel greene
> Sent: Thursday, September 09, 2004 12:17 PM
> To: firstname.lastname@example.org
> Subject: embedded system - no double
> I wanna use lua in a embedded system project.
> Therefore I don't wanna use the standard type for numbers
> (double) - this needs too much performance.
> Is there a global way to convert to another type like int?
> I've tried to change this in lua.h.
> /* type of numbers in Lua */
> #ifndef LUA_NUMBER
> typedef int lua_Number; // changed to int
> typedef LUA_NUMBER lua_Number;
> It seems to be okay. Any comments?
> Is there a better way to to this?
> I know after that it's not possible to calculate. with float types.