[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Strange behaviour in hexadecimal numbers
- From: Alexandra Barros <alexandra.barros@...>
- Date: Thu, 19 Jan 2012 15:05:32 -0200
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
All the best,
Alexandra Barros.