Operator Reference
tuple_median (Operator)
tuple_median
— Return the median of the elements of a tuple.
Signature
Description
tuple_median
calculates the median of all elements of the
input tuple Tuple
and returns it in the output parameter
Median
. 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_rank
).
Note that for an even number of input elements, this will return the upper
median, not the arithmetic median. To calculate the arithmetic median, you
can use tuple_select_rank
to select the upper and lower median values
and then calculate the arithmetic mean of both values.
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_median
,
which can be used in an expression in the following syntax:
Median := median(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
Tuple
(input_control) number(-array) →
(integer / real)
Input tuple.
Median
(output_control) number →
(integer / real)
Median of the tuple elements.
Alternatives
See also
tuple_mean
,
tuple_min
,
tuple_max
Module
Foundation