TIAMedian

From SCAR Divi Manual
Revision as of 17:24, 12 December 2012 by Freddy (talk | contribs) (Examples)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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

See Also