lua-users home
lua-l archive

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

On 23 December 2014 at 11:47, Soni L. <> wrote:
> From
> "*n": reads a number; this is the only format that returns a number instead of a string.
> How does it "read a number"? Can I make my implementation read an unary number?

Reads a number in the same way `tonumber(mystring)`, coercion, or
anything else in lua does.

> following the rules of the Lua lexer. (The string may have leading and trailing spaces and a sign.)
> A numerical constant can be written with an optional fractional part and an optional decimal exponent, marked by a letter 'e' or 'E'.
> Lua also accepts hexadecimal constants, which start with 0x or 0X.
> Hexadecimal constants also accept an optional fractional part plus an optional binary exponent, marked by a letter 'p' or 'P'