Binary "Shift Left" operator?

David Bovill david at openpartnership.net
Tue Apr 29 12:23:22 EDT 2008


I am reverse engineering a Javascript function which uses a "shift left"
operator:

> Shift Left Operator
>
> The shift left operator is binary. The syntax is
>
> *operand1* << *operand2*
>
>  You obtain the result of the expression by treating *operand1* as a set
> of 32 bits and shifting the bits left by the value in *operand2*.
> High-order bits are discarded, and the low-order bits are filled with 0's.
>
> Example:
>
> var tmp = 31 << 3;
>
>  In this example, *operand1* is 31 (00000000000000000000000000011111) and
> *operand2* is 3. tmp is set to 248 (00000000000000000000000011111000).
>
Is there an equivalent in Rev - if not can anyone translate this to some
basic math functions?



More information about the use-livecode mailing list