lua-users home
lua-l archive

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


> >I tried it with Lua 4, and it made quite a large difference, esp. if you
> >used the dodgy switches to speed floating point operations.
> 
> With gcc, try compiling Lua 5.0 (beta) using these switches:
> 
>   -D'lua_number2int(i,d)=__asm__("fldl %1\nfistpl %0":"=m"(i):"m"(d))'

The above will perform non-ANSI compliant double -> int rounding.  As I recall, 
negative numbers will not round to the same number as ordinary casting (one rounds 
towards zero, and the other just rounds downward, as I recall.)


--
Paul Hsieh
qed@pobox.com