Product(Values: Array): Double;
Product(Values: System.Array): double;
Values. Array of real numbers.
The Product method returns the product of all number of the set array.
If an array of real numbers contains gaps, the function returns error.
The function works correctly with both one-dimension and two-dimension arrays.
To execute the example, add a link to the MathFin system assembly.
Sub UserProc;
Var
r: Double;
Arr: Array[3] Of Double;
Begin
Arr[0] := 5;
Arr[1] := 15;
Arr[2] := 30;
r := Math.Product(Arr);
Debug.WriteLine(r);
End Sub UserProc;
After executing the example the console window displays the result of the product equal to 2250.
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[3] Of Double;
Begin
Arr[0] := 5;
Arr[1] := 15;
Arr[2] := 30;
r := Math.Product(Arr);
System.Diagnostics.Debug.WriteLine(r);
End Sub;
See also: