[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Binary notation for integers: 0b[10]+
- From: Javier Guerra Giraldez <javier@...>
- Date: Mon, 1 Dec 2014 14:02:29 -0500
On Mon, Dec 1, 2014 at 1:52 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
> Or just this:
>
> function b(s)
> return tonumber(s:gsub("[^%d]",""),2)
> end
right! i was digging the ones i actually use, and found my override to
tonumber that accepts '0b' in addition to '0x'. and of course with a
:gsub('[^%w]','') to remove weird things...
--
Javier