BITTEST


BITTEST tests the bit number of the integer specified by an expression.

The function returns 1 if the bit is set; it returns 0 if it is not; Bits are counted from right to left. The

number of the rightmost bit is 0.

If expression evaluates to the null value, null is returned. If bit# evaluates to null, the BITTEST

function fails and the program terminates with a run-time error message.

Non integer values are truncated before the operation is performed.

 

 

COMMAND SYNTAX

BITTEST(expression, bit#)

 

EXAMPLE

PRINT BITTEST(11,0),BITTEST(11,1),BITTEST(11,2),BITTEST(11,3)

* The binary value of 11 = 1011

This is the program output:

1 1 0 1


jBC