tuple_lshtuple_lshTupleLshTupleLshtuple_lsh (算子)

名称

tuple_lshtuple_lshTupleLshTupleLshtuple_lsh — 按位向左移动元组。

签名

tuple_lsh( : : T, Shift : Lsh)

Herror tuple_lsh(const Hlong T, const Hlong Shift, Hlong* Lsh)

Herror T_tuple_lsh(const Htuple T, const Htuple Shift, Htuple* Lsh)

void TupleLsh(const HTuple& T, const HTuple& Shift, HTuple* Lsh)

HTuple HTuple::TupleLsh(const HTuple& Shift) const

static void HOperatorSet.TupleLsh(HTuple t, HTuple shift, out HTuple lsh)

HTuple HTuple.TupleLsh(HTuple shift)

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

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

描述

tuple_lshtuple_lshTupleLshTupleLshTupleLshtuple_lsh shifts the tuple TTTTtt bitwise to the left by ShiftShiftShiftShiftshiftshift places. If no overflow occurs, this operation is equivalent to a multiplication 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 either or both of the input tuples are empty, the operator returns an empty tuple.

HDevelop 内联操作

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

Lsh := lsh(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.

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

Shifted input tuple.

替代

tuple_multtuple_multTupleMultTupleMultTupleMulttuple_mult

另见

tuple_rshtuple_rshTupleRshTupleRshTupleRshtuple_rsh

模块

基础