File tree Expand file tree Collapse file tree 15 files changed +232
-244
lines changed Expand file tree Collapse file tree 15 files changed +232
-244
lines changed Original file line number Diff line number Diff line change 1- function ArithMean (const A: array of Double): Double; overload;
1+ function ArithmeticMean (const A: array of Double): Double; overload;
22var
33 X: Double;
44begin
55 if Length(A) = 0 then
6- raise SysUtils.EArgumentException.Create(
7- 'ArithMean: array is empty'
8- );
6+ raise SysUtils.EArgumentException.Create('Array is empty');
97 Result := 0.0;
108 for X in A do
119 Result := Result + X / Length(A);
Original file line number Diff line number Diff line change 1- function ArithMean (const A: array of Integer): Double; overload;
1+ function ArithmeticMean (const A: array of Integer): Double; overload;
22var
33 X: Integer;
44begin
55 if Length(A) = 0 then
6- raise SysUtils.EArgumentException.Create(
7- 'ArithMean: array is empty'
8- );
6+ raise SysUtils.EArgumentException.Create('Array is empty');
97 Result := 0.0;
108 for X in A do
119 Result := Result + X / Length(A);
Original file line number Diff line number Diff line change 1- function ArithMean (const A: array of Cardinal): Double; overload;
1+ function ArithmeticMean (const A: array of Cardinal): Double; overload;
22var
33 X: Cardinal;
44begin
55 if Length(A) = 0 then
6- raise SysUtils.EArgumentException.Create(
7- 'ArithMean: array is empty'
8- );
6+ raise SysUtils.EArgumentException.Create('Array is empty');
97 Result := 0.0;
108 for X in A do
119 Result := Result + X / Length(A);
Original file line number Diff line number Diff line change 1- function WeightedArithMean (const Values: array of Double;
1+ function WeightedArithmeticMean (const Values: array of Double;
22 const Weights: array of Double): Double; overload;
33var
44 WeightSum: Double;
Original file line number Diff line number Diff line change 1- function WeightedArithMean (const Values: array of Integer;
1+ function WeightedArithmeticMean (const Values: array of Integer;
22 const Weights: array of Double): Double; overload;
33var
44 Idx: Integer;
77 SetLength(DblVals, Length(Values));
88 for Idx := Low(Values) to High(Values) do
99 DblVals[Idx] := Values[Idx];
10- Result := WeightedArithMean (DblVals, Weights);
10+ Result := WeightedArithmeticMean (DblVals, Weights);
1111end;
Original file line number Diff line number Diff line change 1- function WeightedArithMean (const Values: array of Cardinal;
1+ function WeightedArithmeticMean (const Values: array of Cardinal;
22 const Weights: array of Double): Double; overload;
33var
44 Idx: Integer;
77 SetLength(DblVals, Length(Values));
88 for Idx := Low(Values) to High(Values) do
99 DblVals[Idx] := Values[Idx];
10- Result := WeightedArithMean (DblVals, Weights);
10+ Result := WeightedArithmeticMean (DblVals, Weights);
1111end;
Original file line number Diff line number Diff line change 1- function GeoMean (const A: array of Double): Double; overload;
1+ function GeometricMean (const A: array of Double): Double; overload;
22begin
33 if System.Length(A) = 0 then
44 raise SysUtils.EArgumentException.Create('Array is empty');
Original file line number Diff line number Diff line change 1- function GeoMean (const A: array of Cardinal): Double; overload;
1+ function GeometricMean (const A: array of Cardinal): Double; overload;
22begin
33 if System.Length(A) = 0 then
44 raise SysUtils.EArgumentException.Create('Array is empty');
Original file line number Diff line number Diff line change 1- function GeoMean (const A: array of Integer): Double; overload;
1+ function GeometricMean (const A: array of Integer): Double; overload;
22begin
33 if System.Length(A) = 0 then
44 raise SysUtils.EArgumentException.Create('Array is empty');
Original file line number Diff line number Diff line change 1- function WeightedGeoMean (const Values: array of Double;
1+ function WeightedGeometricMean (const Values: array of Double;
22 const Weights: array of Double): Double; overload;
33var
44 Sum: Double;
You can’t perform that action at this time.
0 commit comments