tuple_rshtuple_rshTupleRshTupleRshtuple_rsh (算子名称)

名称

tuple_rshtuple_rshTupleRshTupleRshtuple_rsh — Shift a tuple bitwise to the right.

参数签名

tuple_rsh( : : T, Shift : Rsh)

Herror tuple_rsh(const Hlong T, const Hlong Shift, Hlong* Rsh)

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

void TupleRsh(const HTuple& T, const HTuple& Shift, HTuple* Rsh)

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

static void HOperatorSet.TupleRsh(HTuple t, HTuple shift, out HTuple rsh)

HTuple HTuple.TupleRsh(HTuple shift)

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

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

描述

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, 该算子 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)

运行信息

参数表

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.

可替代算子

tuple_divtuple_divTupleDivTupleDivTupleDivtuple_div

参考其它

tuple_lshtuple_lshTupleLshTupleLshTupleLshtuple_lsh

模块

Foundation