bitand()

Scalar. Returns the result of performing a bitwise AND operation on two expressions.

Syntax

bitand ( expression1, expression2 )

Parameters

expression1

Expression that simplifies to an integer or a long (must be the same datatype as expression2).

expression2

Expression that simplifies to an integer or a long (must be the same datatype as expression1).

Usage

The function takes the two expressions, and performs the logical AND operation on each pair of bits. The result for the pair is 1 if both bits are 1; otherwise, the result for the pair is 0. Both arguments must be the same datatype (integers or longs), and the function returns the same datatype as its arguments.

Example

bitand (5, 3) returns 1, or in binary, bitand ( 101, 011) returns 001. The user cannot specify binary directly.