File tree Expand file tree Collapse file tree 16 files changed +636
-15
lines changed Expand file tree Collapse file tree 16 files changed +636
-15
lines changed Original file line number Diff line number Diff line change 12
12
for Elem in A do
13
13
begin
14
14
if Elem = 0 then
15
- raise SysUtils.EArgumentOutOfRangeException(sNotPositive);
15
+ raise SysUtils.EArgumentOutOfRangeException.Create (sNotPositive);
16
16
Result := Result + System.Ln(Elem);
17
17
end;
18
18
end;
Original file line number Diff line number Diff line change 12
12
for Elem in A do
13
13
begin
14
14
if Elem <= 0 then
15
- raise SysUtils.EArgumentOutOfRangeException(sNotPositive);
15
+ raise SysUtils.EArgumentOutOfRangeException.Create (sNotPositive);
16
16
Result := Result + System.Ln(Elem);
17
17
end;
18
18
end;
Original file line number Diff line number Diff line change 12
12
for Elem in A do
13
13
begin
14
14
if Elem <= 0 then
15
- raise SysUtils.EArgumentOutOfRangeException(sNotPositive);
15
+ raise SysUtils.EArgumentOutOfRangeException.Create (sNotPositive);
16
16
Result := Result + System.Ln(Elem);
17
17
end;
18
18
end;
Original file line number Diff line number Diff line change 12
12
for Elem in A do
13
13
begin
14
14
if Elem = 0 then
15
- raise SysUtils.EArgumentOutOfRangeException(sNotPositive);
15
+ raise SysUtils.EArgumentOutOfRangeException.Create (sNotPositive);
16
16
Result := Result + System.Ln(Elem);
17
17
end;
18
18
end;
Original file line number Diff line number Diff line change 12
12
for Elem in A do
13
13
begin
14
14
if Math.Sign(Elem) <> Math.PositiveValue then
15
- raise SysUtils.EArgumentOutOfRangeException(sNotPositive);
15
+ raise SysUtils.EArgumentOutOfRangeException.Create (sNotPositive);
16
16
Result := Result + System.Ln(Elem);
17
17
end;
18
18
end;
Original file line number Diff line number Diff line change 12
12
for Elem in A do
13
13
begin
14
14
if Math.Sign(Elem) <> Math.PositiveValue then
15
- raise SysUtils.EArgumentOutOfRangeException(sNotPositive);
15
+ raise SysUtils.EArgumentOutOfRangeException.Create (sNotPositive);
16
16
Result := Result + System.Ln(Elem);
17
17
end;
18
18
end;
Original file line number Diff line number Diff line change 12
12
for Elem in A do
13
13
begin
14
14
if Math.Sign(Elem) <> Math.PositiveValue then
15
- raise SysUtils.EArgumentOutOfRangeException(sNotPositive);
15
+ raise SysUtils.EArgumentOutOfRangeException.Create (sNotPositive);
16
16
Result := Result + System.Ln(Elem);
17
17
end;
18
18
end;
Original file line number Diff line number Diff line change
1
+ function GeoMean(const A: array of Double): Double; overload;
2
+ begin
3
+ if System.Length(A) = 0 then
4
+ raise SysUtils.EArgumentException.Create('Array is empty');
5
+ Result := System.Exp(SumOfLogs(A) / System.Length(A));
6
+ end;
Original file line number Diff line number Diff line change
1
+ function GeoMean(const A: array of Cardinal): Double; overload;
2
+ begin
3
+ if System.Length(A) = 0 then
4
+ raise SysUtils.EArgumentException.Create('Array is empty');
5
+ Result := System.Exp(SumOfLogs(A) / System.Length(A));
6
+ end;
Original file line number Diff line number Diff line change
1
+ function GeoMean(const A: array of Integer): Double; overload;
2
+ begin
3
+ if System.Length(A) = 0 then
4
+ raise SysUtils.EArgumentException.Create('Array is empty');
5
+ Result := System.Exp(SumOfLogs(A) / System.Length(A));
6
+ end;
You can’t perform that action at this time.
0 commit comments