lua-users home
lua-l archive

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


On 7/4/16, Martin <eden_martin_fuhrspam@gmx.de> wrote:
>> unfortunately, in Lua 5.2 it fails:
>>
>>     -- Lua 5.2
>>     > print(("%x"):format(-123456))
>>     stdin:1: bad argument #1 to 'format' (not a non-negative number in
>> proper range)
>>
>> Is there a solution that works in 5.2 as well?
>>
> print(('%x'):format(bit32.band(-2)))

Works perfectly! Thanks.