tuple_mediantuple_medianTupleMedianTupleMediantuple_median (Operator)

Name

tuple_mediantuple_medianTupleMedianTupleMediantuple_median — Return the median of the elements of a tuple.

Signature

tuple_median( : : Tuple : Median)

Herror tuple_median(const Hlong Tuple, Hlong* Median)

Herror T_tuple_median(const Htuple Tuple, Htuple* Median)

void TupleMedian(const HTuple& Tuple, HTuple* Median)

HTuple HTuple::TupleMedian() const

static void HOperatorSet.TupleMedian(HTuple tuple, out HTuple median)

HTuple HTuple.TupleMedian()

def tuple_median(tuple: MaybeSequence[Union[float, int]]) -> Union[int, float]

Description

tuple_mediantuple_medianTupleMedianTupleMedianTupleMediantuple_median calculates the median of all elements of the input tuple TupleTupleTupleTupletupletuple and returns it in the output parameter MedianMedianMedianMedianmedianmedian. The input tuple may only consist of numbers (integer or floating point numbers). The median is defined as the element with rank n/2 (see tuple_select_ranktuple_select_rankTupleSelectRankTupleSelectRankTupleSelectRanktuple_select_rank).

Exception: Empty input tuple

If the input tuple is empty, an exception is raised.

HDevelop In-line Operation

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

Median := median(Tuple)

Execution Information

Parameters

TupleTupleTupleTupletupletuple (input_control)  number(-array) HTupleMaybeSequence[Union[float, int]]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Input tuple.

MedianMedianMedianMedianmedianmedian (output_control)  number HTupleUnion[int, float]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Median of the tuple elements.

Alternatives

tuple_select_ranktuple_select_rankTupleSelectRankTupleSelectRankTupleSelectRanktuple_select_rank

See also

tuple_meantuple_meanTupleMeanTupleMeanTupleMeantuple_mean, tuple_mintuple_minTupleMinTupleMinTupleMintuple_min, tuple_maxtuple_maxTupleMaxTupleMaxTupleMaxtuple_max

Module

Foundation