C# Class GarrysModLuaShared.bit

The bitwise library contains useful functions for bitwise operations.
Show file Open project: OmegaExtern/gmod-csharp-binary-module

Public Methods

Method Description
arshift ( LuaState luaState, double value, double shiftCount ) : double

Returns the arithmetically shifted value.

band ( LuaState luaState, double value ) : double

Returns the bitwise and of all values specified.

bnot ( LuaState luaState, double value ) : double

Returns the bitwise not of the value.

bor ( LuaState luaState, double value ) : double

Returns the bitwise OR of all values specified.

bswap ( LuaState luaState, double value ) : double

Swaps the byte order.

bxor ( LuaState luaState, double value ) : double

Returns the bitwise xor of all values specified.

lshift ( LuaState luaState, double value, double shiftCount ) : double

Returns the left shifted value.

rol ( LuaState luaState, double value, double shiftCount ) : double

Returns the left rotated value.

ror ( LuaState luaState, double value, double shiftCount ) : double

Returns the right rotated value.

rshift ( LuaState luaState, double value, double shiftCount ) : double

Returns the right shifted value.

tobit ( LuaState luaState, double value ) : double

Normalizes the specified value and clamps it in the range of a signed 32bit integer.

tohex ( LuaState luaState, double value, double digits = 8 ) : string

Returns the hexadecimal representation of the number with the specified digits.

Method Details

arshift() public static method

Returns the arithmetically shifted value.
public static arshift ( LuaState luaState, double value, double shiftCount ) : double
luaState LuaState Pointer to lua_State struct.
value double The value to be manipulated.
shiftCount double Amount of bits to shift.
return double

band() public static method

Returns the bitwise and of all values specified.
public static band ( LuaState luaState, double value ) : double
luaState LuaState Pointer to lua_State struct.
value double The value to be manipulated.
return double

bnot() public static method

Returns the bitwise not of the value.
public static bnot ( LuaState luaState, double value ) : double
luaState LuaState Pointer to lua_State struct.
value double The value to be inverted.
return double

bor() public static method

Returns the bitwise OR of all values specified.
public static bor ( LuaState luaState, double value ) : double
luaState LuaState Pointer to lua_State struct.
value double The first value.
return double

bswap() public static method

Swaps the byte order.
public static bswap ( LuaState luaState, double value ) : double
luaState LuaState Pointer to lua_State struct.
value double The value to be byte swapped.
return double

bxor() public static method

Returns the bitwise xor of all values specified.
public static bxor ( LuaState luaState, double value ) : double
luaState LuaState Pointer to lua_State struct.
value double The value to be manipulated.
return double

lshift() public static method

Returns the left shifted value.
public static lshift ( LuaState luaState, double value, double shiftCount ) : double
luaState LuaState Pointer to lua_State struct.
value double The value to be manipulated.
shiftCount double Amount of bits to shift left by.
return double

rol() public static method

Returns the left rotated value.
public static rol ( LuaState luaState, double value, double shiftCount ) : double
luaState LuaState Pointer to lua_State struct.
value double The value to be manipulated.
shiftCount double Amount of bits to rotate left by.
return double

ror() public static method

Returns the right rotated value.
public static ror ( LuaState luaState, double value, double shiftCount ) : double
luaState LuaState Pointer to lua_State struct.
value double The value to be manipulated.
shiftCount double Amount of bits to rotate right by.
return double

rshift() public static method

Returns the right shifted value.
public static rshift ( LuaState luaState, double value, double shiftCount ) : double
luaState LuaState Pointer to lua_State struct.
value double The value to be manipulated.
shiftCount double Amount of bits to shift right by.
return double

tobit() public static method

Normalizes the specified value and clamps it in the range of a signed 32bit integer.
public static tobit ( LuaState luaState, double value ) : double
luaState LuaState Pointer to lua_State struct.
value double The value to be normalized.
return double

tohex() public static method

Returns the hexadecimal representation of the number with the specified digits.
public static tohex ( LuaState luaState, double value, double digits = 8 ) : string
luaState LuaState Pointer to lua_State struct.
value double The value to be converted.
digits double The number of digits. Optional.
return string