Skip to content

tuple_rshTupleRshTupleRshtuple_rshtuple_rsh🔗

Short description🔗

tuple_rshTupleRshTupleRshtuple_rshtuple_rsh — Shift a tuple bitwise to the right.

Signature🔗

tuple_rsh( integer T, integer Shift, out integer Rsh )void TupleRsh( const HTuple& T, const HTuple& Shift, HTuple* Rsh )static void HOperatorSet.TupleRsh( HTuple t, HTuple shift, out HTuple rsh )def tuple_rsh( t: MaybeSequence[int], shift: MaybeSequence[int] ) -> Sequence[int]

def tuple_rsh_s( t: MaybeSequence[int], shift: MaybeSequence[int] ) -> intHerror tuple_rsh( const Hlong T, const Hlong Shift, Hlong* Rsh )

Herror T_tuple_rsh( const Htuple T, const Htuple Shift, Htuple* Rsh )

HTuple HTuple::TupleRsh( const HTuple& Shift ) const

HTuple HTuple.TupleRsh( HTuple shift )

Description🔗

tuple_rshTupleRsh shifts the tuple Ttt bitwise to the right by Shiftshiftshift places. This operation is equivalent to a division 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 tuple🔗

If any of the input tuples is empty, the operator returns an empty tuple.

HDevelop In-line Operation🔗

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

Rsh := rsh(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.

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

Shifted input tuple.

Combinations with other operators🔗

Combinations

Alternatives

tuple_divTupleDiv

See also

tuple_lshTupleLsh

Module🔗

Foundation