tuple_sumtuple_sumTupleSumTupleSumtuple_sum (Operator)
Name
tuple_sumtuple_sumTupleSumTupleSumtuple_sum
— Return the sum of all elements of a tuple.
Signature
Herror tuple_sum(const Hlong Tuple, double* Sum)
Herror T_tuple_sum(const Htuple Tuple, 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]
Description
tuple_sumtuple_sumTupleSumTupleSumtuple_sum
returns the sum of all elements
of the input tuple TupleTupleTupletupletuple
. All elements of TupleTupleTupletupletuple
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 SumSumSumsumsum
will contain a floating point number, if
at least one element of TupleTupleTupletupletuple
is a floating point number.
If all elements of TupleTupleTupletupletuple
are integer numbers the resulting
sum will also be an integer number. If TupleTupleTupletupletuple
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_sumtuple_sumTupleSumTupleSumtuple_sum
,
which can be used in an expression in the following syntax:
Sum := sum(Tuple)
Execution Information
- Multithreading type: independent (runs in parallel even with exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
TupleTupleTupletupletuple
(input_control) tuple(-array) →
HTupleMaybeSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
Input tuple.
SumSumSumsumsum
(output_control) tuple(-array) →
HTupleSequence[Union[float, int, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
Sum of tuple elements.
Alternatives
tuple_meantuple_meanTupleMeanTupleMeantuple_mean
,
tuple_deviationtuple_deviationTupleDeviationTupleDeviationtuple_deviation
,
tuple_mintuple_minTupleMinTupleMintuple_min
,
tuple_maxtuple_maxTupleMaxTupleMaxtuple_max
,
tuple_lengthtuple_lengthTupleLengthTupleLengthtuple_length
,
tuple_mediantuple_medianTupleMedianTupleMediantuple_median
See also
tuple_cumultuple_cumulTupleCumulTupleCumultuple_cumul
Module
Foundation