ClassesClasses | | Operators

tuple_sumtuple_sumTupleSumTupleSum (Operator)


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


tuple_sum( : : Tuple : Sum)

Herror tuple_sum(const Hlong Tuple, double* Sum)

Herror T_tuple_sum(const Htuple Tuple, Htuple* Sum)

void TupleSum(const HTuple& Tuple, HTuple* Sum)

HTuple HTuple::TupleSum() const

static void HOperatorSet.TupleSum(HTuple tuple, out HTuple sum)

HTuple HTuple.TupleSum()


tuple_sumtuple_sumTupleSumTupleSumTupleSum 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_sumTupleSumTupleSumTupleSum, which can be used in an expression in the following syntax:

Sum := sum(Tuple)

Execution Information


TupleTupleTupleTupletuple (input_control)  number(-array) HTupleHTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

Input tuple.

SumSumSumSumsum (output_control)  number(-array) HTupleHTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Sum of tuple elements.


tuple_meantuple_meanTupleMeanTupleMeanTupleMean, tuple_deviationtuple_deviationTupleDeviationTupleDeviationTupleDeviation, tuple_mintuple_minTupleMinTupleMinTupleMin, tuple_maxtuple_maxTupleMaxTupleMaxTupleMax, tuple_lengthtuple_lengthTupleLengthTupleLengthTupleLength, tuple_mediantuple_medianTupleMedianTupleMedianTupleMedian

See also




ClassesClasses | | Operators