Documentation/Calc Functions/BITLSHIFT/en

Function name:
BITLSHIFT

Category:
Mathematical

Summary:
Left shifts a non-negative integer value by the specified number of bits.

Syntax:
BITLSHIFT(Number; Shift)

Returns:
Returns a non-negative integer, that is the original number shifted by the specified number of bits.

Arguments:
Number is an integer in the range [0, 248-1], or a reference to a cell containing that number, that is the value to be shifted.

Shift is an integer, or a reference to a cell containing that number, that is the number of bit positions to shift. If Shift is positive, then Number is shifted to the left. If Shift is negative, then Number is shifted to the right and this would be equivalent to BITRSHIFT(Number; -Shift).


 * If either Number or Shift is non-numeric, then BITLSHIFT reports a #VALUE! error.
 * If either Number or Shift is a non-integer value, then BITLSHIFT converts it to an integer by taking its floor value.
 * If Number is less than 0 or greater than 248-1, then BITLSHIFT reports an invalid argument error (Err:502).

Additional details:

 * A left shift by N (N > 0) is equivalent to multiplying by 2N and effectively adds zeros at the right end of the binary representation of the number.
 * More information is available on Wikipedia’s Bitwise operation page.
 * 248 is equal to 281474976710656.

Related LibreOffice functions:
BITAND

BITOR

BITRSHIFT

BITXOR

ODF standard:
Section 6.6.3, Part 2

Equivalent Excel functions:
BITLSHIFT