BITAND

Syntax

BITAND(expr1, expr2)

Overview

BITAND operations are processed as vectors consisting of inputs and outputs in bits. The output is the result of AND operations performed on the inputs in bits.

BITAND is calculated through the following steps.

  1. Argument A is replaced by SIGN(A) * FLOOR(ABS(A)).

  2. Argument A is converted to an n-bit two's complement binary integer value. 2-bit values are combined using a bitwise AND operation.

  3. n-bit two's complement value is converted back to NUMBER.

Parameter

Parameter
Description

expr1, expr2

If any of the arguments of an arbitrary operation that returns an integer value is NULL, the result is NULL. Arguments must be within the range -(2^(n-1)) to (2^(n-1) - 1). If the argument is out of range, the result is undefined.* Currently, n is 64.

Example

SELECT BITAND(6,3);

 bitand 
--------
      2

Last updated