lua-users home
lua-l archive

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


You needn't worry if your Lua program:

- does not produce large numbers; or
- does any division or power or call any mathematical function such as
  sqrt, log, etc; or
- mixes integer and float literals.

The reason is that once a computation sees a float, it produces a float.

You need to worry only if you program has been written as a integer-only code,
like the factorial example discussed earlier.

Assuming that your program is a pure Lua program, then one way to be
sure that it does not fail because of unintended integers is to make
a one-line change to Lua 5.3 and rerun it and see if you get the same
results: just disable l_str2int by adding "return NULL" right at the
beginning of l_str2int in lobject.c.

This will not help you fix your program to avoid unintended integers,
so I guess it does not answer your question...