lua-users home
lua-l archive

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

Matthew Paul Del Buono wrote:
> ... the following line would cause the system to go into ...
> an infinite loop:
> t = {};
> table.insert(t, 2^31, 1);
> After researching, however, it appears that this is due to
> the fact that 2^31 becomes a negative number.

IMO there are two problems:

  (1) 2^31 should not become a negative number.

  (2) Inserting at any location on an empty table should not require
that much time.

The solution you posted addresses (2). I'm still worried about (1),
though. The 5.1 LRM says that 'Exponentiation works for any exponent.'
(, but doesn't mention
this boundary condition. I see how it happens but I think it should be a
positive number.


Innovative Concepts, Inc. 703-893-2007 x220