tuple_rshtuple_rshTupleRshTupleRshtuple_rsh (Operator)
Name
tuple_rshtuple_rshTupleRshTupleRshtuple_rsh
— Shift a tuple bitwise to the right.
Signature
Herror tuple_rsh(const Hlong T, const Hlong Shift, Hlong* Rsh)
Herror T_tuple_rsh(const Htuple T, const Htuple Shift, Htuple* Rsh)
def tuple_rsh(t: MaybeSequence[int], shift: MaybeSequence[int]) -> Sequence[int]
def tuple_rsh_s(t: MaybeSequence[int], shift: MaybeSequence[int]) -> int
Description
tuple_rshtuple_rshTupleRshTupleRshtuple_rsh
shifts the tuple TTTtt
bitwise to the right
by ShiftShiftShiftshiftshift
places. This operation is equivalent to a
division 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 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_rshtuple_rshTupleRshTupleRshtuple_rsh
,
which can be used in an expression in the following syntax:
Rsh := rsh(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.
RshRshRshrshrsh
(output_control) integer(-array) →
HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Shifted input tuple.
Alternatives
tuple_divtuple_divTupleDivTupleDivtuple_div
See also
tuple_lshtuple_lshTupleLshTupleLshtuple_lsh
Module
Foundation