lua-users home
lua-l archive

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

Mike Pall wrote:

As to why you're seeing differences between script and interactive
execution: Lua folds constants while parsing and this indirectly
calls pow() for the ^ operator. A script is parsed in one go, but
the interactive prompt runs the parser for every line.

Calling floor() on behalf of the % operator apparently screws up
the FPU state. The non-constant folded ^ operator is thus always
affected, but the constant-folded one is only affected if the
parsing is done afterwards.

There's almost always someone here with the right combination of
expertise and the ability to explain the possible sources of the

And I learned something about the parser and the prompt too.