Skip to content

tuple_sumTupleSumTupleSumtuple_sumtuple_sum🔗

Short description🔗

tuple_sumTupleSumTupleSumtuple_sumtuple_sum — Return the sum of all elements of a tuple.

Signature🔗

tuple_sum( tuple Tuple, out tuple Sum )void TupleSum( const HTuple& Tuple, HTuple* Sum )static void HOperatorSet.TupleSum( HTuple tuple, out HTuple sum )def tuple_sum( tuple: MaybeSequence[Union[float, int, str]] ) -> Sequence[Union[float, int, str]]

def tuple_sum_s( tuple: MaybeSequence[Union[float, int, str]] ) -> Union[float, int, str]Herror tuple_sum( const Hlong Tuple, double* Sum )

Herror T_tuple_sum( const Htuple Tuple, Htuple* Sum )

HTuple HTuple::TupleSum( ) const

HTuple HTuple.TupleSum( )

Description🔗

tuple_sumTupleSum returns the sum of all elements of the input tuple Tupletupletuple. All elements of Tupletupletuple either have to be strings or numbers (integer or floating point numbers). It is not allowed to mix strings with numerical values. The result parameter Sumsumsum will contain a floating point number, if at least one element of Tupletupletuple is a floating point number. If all elements of Tupletupletuple are integer numbers the resulting sum will also be an integer number. If Tupletupletuple contains strings, the concatenation will be used for building the sum.

Exception: Empty input tuple🔗

If the input tuple is empty, the operator returns an empty tuple.

HDevelop In-line Operation🔗

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

Sum := sum(Tuple)

Execution information🔗

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

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

  • Processed without parallelization.

Parameters🔗

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

Input tuple.

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 tuple elements.

Combinations with other operators🔗

Combinations

Alternatives

tuple_meanTupleMean, tuple_deviationTupleDeviation, tuple_minTupleMin, tuple_maxTupleMax, tuple_lengthTupleLength, tuple_medianTupleMedian

See also

tuple_cumulTupleCumul

Module🔗

Foundation