Getbit

getbit returns the bit value of a bit from an integer. The result is an integer that can have a value of 0 or 1.

Syntax

 getBit( INT_VALUE, BIT_TO_GET)

Syntax

 getbit(E,N)

Example

 Local Integer INT_VALUE,RESULTINT_VALUE=8RESULT = getBit(INT_VALUE,4) # RESULT = 1. Note Bit numbers start at 1, not 0. That is 2^(4-1)=8

See also

setbit.