lua-users home
lua-l archive

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


On 1/20/2012 1:05 AM, Alexandra Barros wrote:
Hi all,

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

Search for:
hexadecimal floating-point

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia