IStatistics.AverageDcml

Fore Syntax

AverageDcml(Values: Array): Decimal;

Fore.NET Syntax

AverageDcml(Values: System.Array): decimal;

Parameters

Values. An array of decimal high-precision numbers, for which it is required to calculate arithmetical mean.

Description

The AverageDcml method returns arithmetic mean of arguments of the Decimal type.

Comments

To determine the number of the Decimal type in the array, it is necessary to write the "m" character after the value of each number. For example: 0.001m.

To get median of set decimal high-precision numbers, use the IStatistics.MedianDcml method.

Fore Example

To execute the example, add a link to the Stat system assembly.

Sub UserProc;
Var
    st: Statistics;
    a: Array[3Of Variant;
    s: Decimal;
Begin
    st := New Statistics.Create;
    a[0] := 0.858739815m;
    a[1] := 0.148393423m;
    a[2] := 0.537711777m;
    s:=st.AverageDcml(a);
    Debug.WriteLine("Mean: " + s.ToString);
End Sub UserProc;

After executing the example the console window displays arithmetical mean for the set of decimal high-precision numbers.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Stat;

Public Shared Sub Main(Params: StartParams);
Var
    st: Statistics;
    a: Array[3Of object;
    s: decimal;
Begin
    st := New Statistics.Create();
    a[0] := 0.858739815m;
    a[1] := 0.148393423m;
    a[2] := 0.537711777m;
    s:=st.AverageDcml(a);
    System.Diagnostics.Debug.WriteLine("Mean: " + s.ToString());
End Sub;

See also:

IStatistics