TEAMedian

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

Definition

function TEAMedian(const TEA: TExtArray): Extended;

Availability

SCAR Divi 3.38 > Current

Description

Returns the statistical median of the extended values in the given TExtArray TEA. Throws an exception if TEA is empty.

Examples

Example 1

var
  TEA: TExtArray;

begin
  TEA := [1.1, 5.5, 4.3, 1.2, 5.4];
  WriteLn(TEAMedian(TEA));
end.

Output:

4.3

Example 2

var
  TEA: TExtArray;

begin
  TEA := [1.1, 4.3, 1.2, 5.4];
  WriteLn(TEAMedian(TEA));
end.

Output:

2.75

See Also