tuple_sumtuple_sumTupleSumTupleSumtuple_sum (算子)
名称
tuple_sumtuple_sumTupleSumTupleSumtuple_sum — 返回元组中所有元素的和。
签名
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]
描述
tuple_sumtuple_sumTupleSumTupleSumTupleSumtuple_sum returns the sum of all elements
of the input tuple TupleTupleTupleTupletupletuple. All elements of TupleTupleTupleTupletupletuple
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 SumSumSumSumsumsum will contain a floating point number, if
at least one element of TupleTupleTupleTupletupletuple is a floating point number.
If all elements of TupleTupleTupleTupletupletuple are integer numbers the resulting
sum will also be an integer number. If TupleTupleTupleTupletupletuple contains strings,
the concatenation will be used for building the sum.
例外:空输入元组
If the input tuple is empty, the operator returns an empty tuple.
HDevelop 内联操作
HDevelop provides an in-line operation for tuple_sumtuple_sumTupleSumTupleSumTupleSumtuple_sum,
which can be used in an expression in the following syntax:
Sum := sum(Tuple)
执行信息
- 多线程类型:独立(即使使用独占算子也能并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
TupleTupleTupleTupletupletuple (输入控制) tuple(-array) → HTupleMaybeSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
Input tuple.
SumSumSumSumsumsum (输出控制) 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.
替代
tuple_meantuple_meanTupleMeanTupleMeanTupleMeantuple_mean,
tuple_deviationtuple_deviationTupleDeviationTupleDeviationTupleDeviationtuple_deviation,
tuple_mintuple_minTupleMinTupleMinTupleMintuple_min,
tuple_maxtuple_maxTupleMaxTupleMaxTupleMaxtuple_max,
tuple_lengthtuple_lengthTupleLengthTupleLengthTupleLengthtuple_length,
tuple_mediantuple_medianTupleMedianTupleMedianTupleMediantuple_median
另见
tuple_cumultuple_cumulTupleCumulTupleCumulTupleCumultuple_cumul
模块
基础