[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Strange behaviour in hexadecimal numbers
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 19 Jan 2012 16:27:24 -0200
> I stumbled upon a weird behaviour in hexadecimal constants in Lua
> 5.2.0 (and LuaJIT 2.0.0-beta8).
>
> When adding a hexadecimal number ending with E it gives a "malformed
> number" error, unless I insert a blank space between E and the plus
> sign. Looks like the lexer is tokenizing it as an invalid floating
> point number. Tests follow...
>
> > print(0xE)
> 14
> > print(0xE+9)
> stdin:1: malformed number near '0xE+9'
> > print(0xE +9)
> 23
> > print(0xA+9)
> 19
Yes, this is a bug. Thanks for the report.
-- Roberto