2
0
mirror of https://github.com/OTCv8/otclientv8.git synced 2025-05-01 03:39:19 +02:00
2019-10-02 03:38:52 +02:00

17 lines
251 B
Lua

Bit = {}
function Bit.bit(p)
return 2 ^ p
end
function Bit.hasBit(x, p)
return x % (p + p) >= p
end
function Bit.setbit(x, p)
return Bit.hasBit(x, p) and x or x + p
end
function Bit.clearbit(x, p)
return Bit.hasBit(x, p) and x - p or x
end