Max(Values: Array): Double;
Max(Values: System.Array): double;
Values. Array of real numbers.
The Max method returns the maximum value from the specified set of values.
The function works correctly with both one-dimension and two-dimension arrays.
To get the least value from the specified set, use the IMath.Min method.
To execute the example, add a link to the MathFin system assembly.
Sub UserProc;
Var r: Double;
arr: array[5] Of Double;
Begin
Arr[0] := 10.8;
Arr[1] := 7.19;
Arr[2] := 9.56;
Arr[3] := 27.96;
Arr[4] := 2;
r:= math.Max(arr);
Debug.WriteLine(r);
End Sub UserProc;
After executing the example the console window displays the greatest value equal to 27.96.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.MathFin;
…
Public Shared Sub Main(Params: StartParams);
Var
r: double;
Math: MathClass = New MathClass();
Arr: Array[5] Of double;
Begin
Arr[0] := 10.8;
Arr[1] := 7.19;
Arr[2] := 9.56;
Arr[3] := 27.96;
Arr[4] := 2;
r := Math.Max(Arr);
System.Diagnostics.Debug.WriteLine(r);
End Sub;
See also: