TIAMedian
From SCAR Divi Manual
Contents
Definition
function TIAMedian(const TIA: TIntArray): Extended;
Availability
SCAR Divi 3.38 > Current
Description
Returns the statistical median of the integer values in the given TIntArray TIA. Throws an exception if TIA is empty.
Examples
Example 1
var TIA: TIntArray; begin TIA := [1, 5, 4, 1, 5]; WriteLn(TIAMedian(TIA)); end.
Output:
4
Example 2
var TIA: TIntArray; begin TIA := [1, 4, 1, 5]; WriteLn(TIAMedian(TIA)); end.
Output:
2.5