NAME ^

lib/bitlib.pir - bitwise operations library

DESCRIPTION ^

bitlib is a library for Lua 5.1 that provides bitwise operations.

See original on http://luaforge.net/projects/bitlib/

The library provides the constant bit.bits that gives the number of bits that can be used in bitwise operations, and the following functions:

Functions ^

bit.cast (a)

cast a to the internally-used integer type

bit.bnot (a)

returns the one's complement of a

bit.band (a, ...)

returns the bitwise and of the w's

bit.bor (a, ...)

returns the bitwise or of the w's

bit.bxor (a, ...)

returns the bitwise exclusive or of the w's

bit.lshift (a, b)

returns a shifted left b places

bit.rshift (a, b)

returns a shifted right b places

bit.arshift (a, b)

returns a shifted arithmetically right b places

AUTHORS ^

Francois Perrad


parrot