Hello,
I have also made the inverse resetbit() function that could be useful :
I have also made the inverse resetbit() function that could be useful :
Code:
function resetbit(value, bitnr)
local mask
mask = bit.lshift(1, bitnr)
mask = bit.bnot(mask)
return bit.band(value, mask)
end