Large(Data: Array; Position: Integer): Double;
Data is an array of data for which the k-th greatest value is calculated. Array value must be greater than zero (0);
Position is a position (starting from the greatest one) in a data array. Available values are taken from the range (0, length Data].
The Large method returns the k-th greatest value from a data set. This function enables the user to select a value by its relative position.
To execute the example, add a link to the Stat system assembly.
Sub UserProc;
Var
st: Statistics;
d0: Double;
y: Array Of Double;
Begin
y := New Double[7];
y[00] := 6;
y[01] := 7;
y[02] := 9;
y[03] := 15;
y[04] := 21;
y[05] := 24;
y[06] := 25;
st := New Statistics.Create;
d0 := st.Large(y,3);
Debug.WriteLine("The 3rd greatest value: " + d0.ToString);
d0 := st.Large(y,6);
Debug.WriteLine("The 6-th greatest value: " + d0.ToString);
End Sub UserProc;
Executing the example shows the results in the console window:
Unit execution started
Third greatest number: 21
Sixth largest number: 7
Unit execution finished
See also: