Operator Reference

tuple_lshtuple_lshTupleLshTupleLshtuple_lsh (Operator)

tuple_lshtuple_lshTupleLshTupleLshtuple_lsh — Shift a tuple bitwise to the left.

Signature

tuple_lsh( : : T, Shift : Lsh)

Herror tuple_lsh(const Hlong T, const Hlong Shift, Hlong* Lsh)

Herror T_tuple_lsh(const Htuple T, const Htuple Shift, Htuple* Lsh)

void TupleLsh(const HTuple& T, const HTuple& Shift, HTuple* Lsh)

HTuple HTuple::TupleLsh(const HTuple& Shift) const

static void HOperatorSet.TupleLsh(HTuple t, HTuple shift, out HTuple lsh)

HTuple HTuple.TupleLsh(HTuple shift)

def tuple_lsh(t: MaybeSequence[int], shift: MaybeSequence[int]) -> Sequence[int]

def tuple_lsh_s(t: MaybeSequence[int], shift: MaybeSequence[int]) -> int

Description

tuple_lshtuple_lshTupleLshTupleLshtuple_lsh shifts the tuple TTTtt bitwise to the left by ShiftShiftShiftshiftshift places. If no overflow occurs, this operation is equivalent to a multiplication by 2^{ShiftShiftShiftshiftshift}. If TTTtt is negative, the result depends on the hardware. If ShiftShiftShiftshiftshift is negative or larger than 32, the result is undefined. If both tuples have the same length the corresponding elements of both tuples are shifted. Otherwise, either TTTtt or ShiftShiftShiftshiftshift must have length 1. In this case, the operation is performed for each element of the longer tuple with the single element of the other tuple. The input tuples must contain only integer numbers.

Exception: Empty input tuples

If either or both of the input tuples are empty, the operator returns an empty tuple.

HDevelop In-line Operation

HDevelop provides an in-line operation for tuple_lshtuple_lshTupleLshTupleLshtuple_lsh, which can be used in an expression in the following syntax:

Lsh := lsh(T, Shift)

Execution Information

  • Multithreading type: independent (runs in parallel even with exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

TTTtt (input_control)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Input tuple.

ShiftShiftShiftshiftshift (input_control)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of places to shift the input tuple.

LshLshLshlshlsh (output_control)  integer(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Shifted input tuple.

Alternatives

tuple_multtuple_multTupleMultTupleMulttuple_mult

See also

tuple_rshtuple_rshTupleRshTupleRshtuple_rsh

Module

Foundation