Bit Operation Functions
The functions described in this section are used to perform operations on variables of the bitset type.
The following functions for Bit Operation described here are:
bitIsSet and bitIsCleared
The bitIsSet
and bitIsCleared
functions evaluate whether an individual bit is set or cleared. This can be done against either an integer, or a bitset value. For integer type, these are convenience functions that can be used instead of the regular logical operators.
boolean bitIsCleared ( int|bitset value, int bitnumber ) boolean bitIsSet ( int|bitset value, int bitnumber )
Parameter | Description |
---|---|
| Bitset or integer to evaluate |
| The bit to evaluate. 0 (zero) is the least significant bit, 31 is the most significant. |
Returns | false or true |
bsCreate
The bsCreate
function creates an empty bitset.
bitset bsCreate()
Parameter | Description |
---|---|
Returns | An (empty) bitset |
bsSet and bsClear
The bsSet and bsClear functions set or clear a bit in a bitset.
void bsClear ( bitset bitset, int bitnumber ) void bsSet ( bitset bitset, int bitnumber )
Parameter | Description |
---|---|
| The bitset to modify |
| The bit to evaluate. 0(zero) is the least significant bit, 31 is the most significant. |
Returns | Nothing |