bitshiftleft()

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

Syntax

bitshiftleft ( 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 right-most bits are set to 0. Must be an integer.

Usage

The bits that are shifted out the left are discarded, and zeros are shifted in on the right. The expression argument can be an integer or a long, but the count argument must be an integer. The function returns the same datatype as the initial expression argument.

Example

bitshiftleft (10, 2) returns 40, or in binary, bitshiftleft (1010, 2) returns 101000. The user cannot specify binary directly.