lua-users home
lua-l archive

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


Hi,

I just discovered Lua a few days ago (and I like it *g*).
The first thing I tried was to make a version without floats.
It was not as easy as it seems according to the config file.
Then I read the mailing list and saw that other people had
the same problem, so here is my patch.

It has some major consequences:

  - No FPU or math library required.
  - Faster on most machines (sieve ~19% on K6/200)
  - Needs less memory (on some machines).
  - Binary API changes!  All functions dealing with
    numbers use the type 'real' instead of 'double'.
  - Floating point numbers are rejected by the lexer
    and by the conversion routines (even in compiled
    code).
  - The mathlib has lost most of its functions.  Only
    abs, min, max, random, and randomseed remain.
    random with no args returns numbers between 0 and
    9999 now.
  - The clock function from iolib returns number of
    multiples of 0.01 seconds.

Ciao, ET.

Attachment: lua-et1.diff.gz
Description: GNU Zip compressed data