lua-users home
lua-l archive

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

Really non-standard, but should I mention the erlang format (maybe ada, too) for N-base constants again?


to re-cap:

2#1001 = binary
8#777 = octal
16#deadbeef = hexadecimal
36#hello = base 36

I have a stale 5.0 patch I can update if anyone cares.


On Thu, Feb 5, 2009 at 4:54 PM, RJP Computing <> wrote:
On Thu, Feb 5, 2009 at 3:04 PM, Sam Roberts <> wrote:
It appears the patch doesn't pass the "0b" prefix to strtol(), it
strips it, and requests base conversion using the last argument to

I like it, its nice for bit fields, and it would be nice to have a %b
string.format specifier, too.

I would love to see this in Lua 5.2.