LShift64 Function

Shifts numeric data to the left by a user specified number of bits.

Syntax
LShift64(number, shiftBits)

Parameters

number
Specify the integer value to be shifted.
shiftBits
Specify the number of bits (integer from 0 to 63) to shift number to the left.

Return Values
Returns a numeric result which is equal to the value of number after shifting left shiftBits number of bits.

Description
LShift64 shifts the specified numeric data (number) to the left (toward a higher order digit) by the specified number of bits (shiftBits). The low order bits shifted are replaced by 0.

The simplest explanation for LShift64 is that it simply returns the result of number * 2 shiftBits.

Note


  • Numeric Data Type:

    The numeric data number may be any valid numeric data type. LShift64 works with data types: Int64 and UInt64.


See Also
And, LShift, Not, Or, RShift, RShift64, Xor

LShift64 Function Example

Function lshiftst
    Int64 i
    Int64 num, snum
    num = 1
    For i = 1 to 10
         Print "i =", i
         snum = LShift64(num, i)
         Print "The shifted num is ", snum
    Next i
Fend

Some other example results from the LShift64 instruction from the command window.

> Print LShift64(2,2)
8
> Print LShift64(5,1)
10
> Print LShift64(3,2)
12
>