lua-users home
lua-l archive

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


> > > The overall idea is quite simple. There will be two kinds of numbers,
> > > integers and floats. 
> > 
> > Does this mean that the following program will fail:
> > 
> > t = { true }
> > assert( t[1.0] )
> 
> No. 1.0 == 1 (although they have differences).

In particular: for table indexing, floats with integer values would
be converted to integers (as Lua already does internally). So,
next({[1.0] = true}) would be 1.0, not 1.

Note that the difference between 1.0 and 1 should be only visible in
corner cases, such as overflows. (Actually, it could be visible in
performance, too; we have to measure that.)

-- Roberto