tuple_addtuple_addTupleAddTupleAddtuple_add (算子)
名称
tuple_addtuple_addTupleAddTupleAddtuple_add — 加两个元组。
签名
Herror tuple_add(double S1, double S2, double* Sum)
Herror T_tuple_add(const Htuple S1, const Htuple S2, Htuple* Sum)
void TupleAdd(const HTuple& S1, const HTuple& S2, HTuple* Sum)
HTuple HTuple::TupleAdd(const HTuple& S2) const
def tuple_add(s1: MaybeSequence[Union[float, int, str]], s2: MaybeSequence[Union[float, int, str]]) -> Sequence[Union[float, int, str]]
def tuple_add_s(s1: MaybeSequence[Union[float, int, str]], s2: MaybeSequence[Union[float, int, str]]) -> Union[float, int, str]
描述
tuple_addtuple_addTupleAddTupleAddTupleAddtuple_add computes the sum of the input tuples S1S1S1S1s1s1
and S2S2S2S2s2s2. If both tuples have the same length the
corresponding elements of both tuples are added. Otherwise, either
S1S1S1S1s1s1 or S2S2S2S2s2s2 must have length 1. In this case, the
addition is performed for each element of the longer tuple with the
single element of the other tuple. If two integer numbers are
added, the result is again an integer number. If a floating point
number is added to another number, the result is a floating point
number. If two strings are added, the addition corresponds to a
string concatenation. If a number and a string are added, the
number is converted to a string first. Thus, the addition also
corresponds to a string concatenation in this case.
例外:空输入元组
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_addtuple_addTupleAddTupleAddTupleAddtuple_add,
which can be used in an expression in the following syntax:
Sum := S1 + S2
The + operation corresponds to a
string concatenation
if S1S1S1S1s1s1 and S2S2S2S2s2s2 contain strings.
执行信息
- 多线程类型:独立(即使使用独占算子也能并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
S1S1S1S1s1s1 (输入控制) tuple(-array) → HTupleMaybeSequence[Union[float, int, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
输入元组 1。
S2S2S2S2s2s2 (输入控制) tuple(-array) → HTupleMaybeSequence[Union[float, int, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
输入元组 2。
SumSumSumSumsumsum (输出控制) tuple(-array) → HTupleSequence[Union[float, int, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
Sum of the input tuples.
替代
tuple_subtuple_subTupleSubTupleSubTupleSubtuple_sub
另见
tuple_cumultuple_cumulTupleCumulTupleCumulTupleCumultuple_cumul
模块
基础