lua-users home
lua-l archive

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

on 3/24/08 3:23 PM, Roberto Ierusalimschy at wrote:

>> Yes, LNUM patch is at the moment The way to optimize Lua integer
>> performance.
>> I have yet to hear what Lua authors think of the latest version, but it
>> would seem to me to be beneficial for the whole language to include the
>> patch (or: parts of it).
> The patch is quite useful, but I am still not comfortable with the idea
> of two kinds of numbers. The problem is that, although the difference is
> mostly invisible, it is not completely invisible. For instance, consider
> the following fragment (ran under (double int64)):
>   y = 1
>   for i=1,60 do y=y*2 end
>   x = (y*1000)/1000
>   print(x == y, x+1 == y+1)   --> true    false
> I know this is a rather artificial example, but I find the result somewhat
> unsettling.

I think the only way this becomes viable is if integers are just a more
"efficient" storage format for floating point values.