ClassesClasses | | Operators

tuple_mediantuple_medianTupleMedianTupleMedian (Operator)

Name

tuple_mediantuple_medianTupleMedianTupleMedian — 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()

Description

tuple_mediantuple_medianTupleMedianTupleMedianTupleMedian calculates the median of all elements of the input tuple TupleTupleTupleTupletuple and returns it in the output parameter MedianMedianMedianMedianmedian. 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_rankTupleSelectRankTupleSelectRankTupleSelectRank).

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

Median := median(Tuple)

Execution Information

Parameters

TupleTupleTupleTupletuple (input_control)  number(-array) HTupleHTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Input tuple.

MedianMedianMedianMedianmedian (output_control)  number HTupleHTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Median of the tuple elements.

Alternatives

tuple_select_ranktuple_select_rankTupleSelectRankTupleSelectRankTupleSelectRank

See also

tuple_meantuple_meanTupleMeanTupleMeanTupleMean, tuple_mintuple_minTupleMinTupleMinTupleMin, tuple_maxtuple_maxTupleMaxTupleMaxTupleMax

Module

Foundation


ClassesClasses | | Operators