Skip to content

tuple_lshTupleLshTupleLshtuple_lshtuple_lsh🔗

Short description🔗

tuple_lshTupleLshTupleLshtuple_lshtuple_lsh — Shift a tuple bitwise to the left.

Signature🔗

tuple_lsh( integer T, integer Shift, out integer Lsh )void TupleLsh( const HTuple& T, const HTuple& Shift, HTuple* Lsh )static void HOperatorSet.TupleLsh( HTuple t, HTuple shift, out HTuple lsh )def tuple_lsh( t: MaybeSequence[int], shift: MaybeSequence[int] ) -> Sequence[int]

def tuple_lsh_s( t: MaybeSequence[int], shift: MaybeSequence[int] ) -> intHerror tuple_lsh( const Hlong T, const Hlong Shift, Hlong* Lsh )

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

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

HTuple HTuple.TupleLsh( HTuple shift )

Description🔗

tuple_lshTupleLsh shifts the tuple Ttt bitwise to the left by Shiftshiftshift places. If no overflow occurs, this operation is equivalent to a multiplication by \(2^{\textrm{Shift}}\). If Ttt is negative, the result depends on the hardware. If Shiftshiftshift 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 Ttt or Shiftshiftshift 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_lshTupleLsh, which can be used in an expression in the following syntax:

Lsh := lsh(T, Shift)

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Ttt (input_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)

Input tuple.

Shiftshiftshift (input_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)

Number of places to shift the input tuple.

Lshlshlsh (output_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Shifted input tuple.

Combinations with other operators🔗

Combinations

Alternatives

tuple_multTupleMult

See also

tuple_rshTupleRsh

Module🔗

Foundation