lua-users home
lua-l archive

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


>>>>> "Payo" == Payo Nel <payonel@hotmail.com> writes:

 Payo> the parser also incorrectly "upgrades" a valid integer to a float
 Payo> value with a minimum integer value:

 Payo> tonumber is correct here:
 Payo> > tonumber('-9223372036854775808',10)
 Payo> -9223372036854775808

 Payo> lexical parse is not
 Payo> > -9223372036854775808
 Payo> -9.2233720368548e+18

That's because this parses as -(9223372036854775808) so it overflows
before the - operator is applied. This is an issue common to many
languages.

-- 
Andrew.