BTST
Boolean function to test if the Nth bit is set on a given number
Implemented by: Gambas
With variations:
Also written as:
Usage
This function returns true or false if, on a given number passed as its first argument, the bit in the Nth position, given as second argument, is respectively 1 or 0. Bit positions are counted from right to left, 0 being the rightmost bit.
bolResult = BTst(15, 3) 'true bolResult = BTst(15, 4) 'false
Comments
Related keywords
Similar keywords
In other languages...
References
- https://gambaswiki.org/wiki/lang/btst , last check 2024-03-03