Skip to content

tuple_addTupleAddTupleAddtuple_addtuple_add🔗

Short description🔗

tuple_addTupleAddTupleAddtuple_addtuple_add — Add two tuples.

Signature🔗

tuple_add( tuple S1, tuple S2, out tuple Sum )void TupleAdd( const HTuple& S1, const HTuple& S2, HTuple* Sum )static void HOperatorSet.TupleAdd( HTuple s1, HTuple s2, out HTuple sum )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]Herror tuple_add( double S1, double S2, double* Sum )

Herror T_tuple_add( const Htuple S1, const Htuple S2, Htuple* Sum )

HTuple HTuple::TupleAdd( const HTuple& S2 ) const

HTuple HTuple.TupleAdd( HTuple s2 )

Description🔗

tuple_addTupleAdd computes the sum of the input tuples S1s1s1 and S2s2s2. If both tuples have the same length the corresponding elements of both tuples are added. Otherwise, either S1s1s1 or S2s2s2 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.

Exception: Empty input tuples🔗

If either or both of the input tuples are empty, the operator returns an empty tuple.

HDevelop In-line Operation🔗

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

Sum := S1 + S2

The + operation corresponds to a

string concatenation

if S1s1s1 and S2s2s2 contain strings.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on internal data level.

Parameters🔗

S1s1s1 (input_control) tuple(-array) → (real / integer / string)HTuple (double / Hlong / HString)HTuple (double / int / long / string)MaybeSequence[Union[float, int, str]]Htuple (double / Hlong / char*)

Input tuple 1.

S2s2s2 (input_control) tuple(-array) → (real / integer / string)HTuple (double / Hlong / HString)HTuple (double / int / long / string)MaybeSequence[Union[float, int, str]]Htuple (double / Hlong / char*)

Input tuple 2.

Sumsumsum (output_control) tuple(-array) → (real / integer / string)HTuple (double / Hlong / HString)HTuple (double / int / long / string)Sequence[Union[float, int, str]]Htuple (double / Hlong / char*)

Sum of the input tuples.

Combinations with other operators🔗

Combinations

Alternatives

tuple_subTupleSub

See also

tuple_cumulTupleCumul

Module🔗

Foundation