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_rshTupleRshTupleRshTupleRshtuple_rsh
shifts the tuple TTTTtt
bitwise to the right
by ShiftShiftShiftShiftshiftshift
places. This operation is equivalent to a
division by 2^{ShiftShiftShiftShiftshiftshift
}. If TTTTtt
is negative, the
result depends on the hardware. If ShiftShiftShiftShiftshiftshift
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 TTTTtt
or ShiftShiftShiftShiftshiftshift
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_rshTupleRshTupleRshTupleRshtuple_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
TTTTtt
(input_control) integer(-array) →
HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Input tuple.
ShiftShiftShiftShiftshiftshift
(input_control) integer(-array) →
HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Number of places to shift the input tuple.
RshRshRshRshrshrsh
(output_control) integer(-array) →
HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Shifted input tuple.
Alternatives
tuple_divtuple_divTupleDivTupleDivTupleDivtuple_div
See also
tuple_lshtuple_lshTupleLshTupleLshTupleLshtuple_lsh
Module
Foundation