bittest()

Scalar. Returns the value of a specific bit in a binary value.

Syntax

bittest ( expression, bit )

Parameters

expression

The initial value, as an integer or a long .

bit

Which bit to return. All other bits are set to zero.

Usage

A bit argument must be an integer. The function returns the same datatype as the datatype of the expression argument.

Example

bittest (15, 3) returns 8, or in binary, bittest( 1111, 3) returns 1000. The user cannot directly specify binary.