Re: Lua Future

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Lua Future

Luiz Henrique de Figueiredo
>From: Edgar Toernig <[hidden email]>

>I made a complete lua with integer arithmetic.  No floating point
>anywhere.  The standard lua has some problem when LUA_NUM_TYPE is
>long - it still uses floating point in a lot of places.

Not "a lot of places", but only in the lexer and in tonumber and tostring:

% grep LUA_NUMBER *.[ch]
lobject.c:double luaO_str2d (char *s) {  /* LUA_NUMBER */
lobject.h:** GREP LUA_NUMBER to change that
lundump.h:#define NUMBER_FMT    "%.16g"         /* LUA_NUMBER */
lvm.c:int luaV_tonumber (TObject *obj) {  /* LUA_NUMBER */
lvm.c:int luaV_tostring (TObject *obj) {  /* LUA_NUMBER */

(NUMBER_FMT in only used in luac.)

Of course, to completely avoid floating point, you have to change the API.
I've promised to write a LTN about this. Will do.
--lhf

Reply | Threaded
Open this post in threaded view
|

Re: Lua Future

Edgar Toernig
Luiz Henrique de Figueiredo wrote:
>
> Of course, to completely avoid floating point, you have to change the API.

That's what I meant when I said: "it still uses floating point in a lot of places."

Ciao, ET.