bitshiftright()

Scalar. Returns the value of an expression after shifting the bits right a specific number of positions.

Syntax

bitshiftright ( expression, count )

Parameters

expression

The initial value, as an integer or a long. Can be an integer or a long.

count

How many positions to shift. The same number of left-most bits are set to 0. Must be an integer.

Usage

The bits that are shifted out the right are discarded, and zeros are shifted in on the left. The function returns the same datatype as the initial expression argument.

Example

bitshiftright (3, 1) returns 1, or in binary, bitshiftright (0011, 1) returns 0001. The user cannot specify binary directly.