tuple_rshtuple_rshTupleRshTupleRshtuple_rsh (算子)

名称

tuple_rshtuple_rshTupleRshTupleRshtuple_rsh — 按位向右移动元组。

签名

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.

例外:空输入元组

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

HDevelop 内联操作

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 (输入控制)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Input tuple.

ShiftShiftShiftShiftshiftshift (输入控制)  integer(-array) HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of places to shift the input tuple.

RshRshRshRshrshrsh (输出控制)  integer(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Shifted input tuple.

替代

tuple_divtuple_divTupleDivTupleDivTupleDivtuple_div

另见

tuple_lshtuple_lshTupleLshTupleLshTupleLshtuple_lsh

模块

基础