TIAMedian

From SCAR Divi Manual
Revision as of 16:19, 12 December 2012 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> function TIAMedian(const TIA: TIntArray): Extended; </source> ==Availability== SCAR Divi 3.38 > Current ==Description== Ret...")
(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, 1, 4, 5, 5];
  WriteLn(TIAMedian(TIA));
end.

Output:

4

Example 2

var
  TIA: TIntArray;

begin
  TIA := [1, 1, 4, 5];
  WriteLn(TIAMedian(TIA));
end.

Output:

2.5

See Also