Boolean function to test if the Nth bit is set on a given number
Implemented by: Gambas
With variations:
Also written as:
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