bit.neg
Lua function bit.neg Summary Bitwise negate (ones complement) Prototype `n = bit.neg (a)` Description `This takes one argument. It is converted to a signed 'long long' (64-bit integer). The result is the ones-complement of the number (zero bits become one, one bits become zero). eg.
    print (bit.neg (1)) --> -2
    print (bit.band (14, bit.neg (8)))  --> 6  (clear 8-bit)
` See Also ... Topics Lua base functions Lua bc (big number) functions Lua bit manipulation functions Lua coroutine functions Lua debug functions Lua io functions Lua math functions Lua os functions Lua package functions Lua PCRE regular expression functions Lua script extensions Lua string functions Lua table functions Lua utilities Scripting Lua functions bit.ashr (Shifts a number right, preserving sign) bit.band (Bitwise 'and') bit.bor (Bitwise 'or') bit.mod (Bitwise 'modulus' (remainder after integer divide)) bit.shl (Shifts a number left) bit.shr (Shifts a number right) bit.tonumber (Convert a string into a number) bit.tostring (Convert a number into a string) bit.xor (Bitwise 'exclusive or') (Help topic: lua=bit.neg) Documentation contents page