Register forum user name Search FAQ

Lua bit manipulation functions

Bit manipulation functions

The Lua language does not contain native support for bit-wise manipulation of numbers (and, or, exclusive or etc.)

MUSHclient has a few simple extensions that permit that.

They are in the library (table) "bit".

Lua functions

bit.ashr - Shifts a number right, preserving sign
bit.band - Bitwise 'and'
bit.bor - Bitwise 'or'
bit.clear - Clears one or more bits
bit.mod - Bitwise 'modulus' (remainder after integer divide)
bit.neg - Bitwise 'negate' (ones complement)
bit.shl - Shifts a number left
bit.shr - Shifts a number right
bit.test - Bitwise 'test'
bit.tonumber - Convert a string into a number
bit.tostring - Convert a number into a string
bit.xor - Bitwise 'exclusive or'

Topics

Lua base functions
Lua bc (big number) functions
Lua coroutine functions
Lua debug functions
Lua io functions
Lua LPEG library
Lua math functions
Lua os functions
Lua package functions
Lua PCRE regular expression functions
Lua script extensions
Lua string functions
Lua syntax
Lua table functions
Lua utilities
Scripting
Scripting callbacks - plugins

(Help topic: general=lua_bit)

Documentation contents page


Search ...

Enter a search string to find matching documentation.

Search for:   

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.