Revert Sum Product для BigInteger
This commit is contained in:
parent
712d87beb8
commit
48222f9576
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "3";
|
||||
public const string Minor = "7";
|
||||
public const string Build = "1";
|
||||
public const string Revision = "2746";
|
||||
public const string Revision = "2747";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%COREVERSION%=1
|
||||
%REVISION%=2746
|
||||
%MINOR%=7
|
||||
%REVISION%=2747
|
||||
%COREVERSION%=1
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
3.7.1.2746
|
||||
3.7.1.2747
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.7.1.2746'
|
||||
!define VERSION '3.7.1.2747'
|
||||
|
|
|
|||
|
|
@ -9745,37 +9745,6 @@ begin
|
|||
Result += f(x);
|
||||
end;}
|
||||
|
||||
/// Возвращает сумму элементов последовательности
|
||||
function Sum(Self: sequence of BigInteger): BigInteger; extensionmethod;
|
||||
begin
|
||||
Result := 0bi;
|
||||
foreach var a in Self do
|
||||
Result += a
|
||||
end;
|
||||
|
||||
/// Возвращает среднее элементов последовательности
|
||||
function Average(Self: sequence of BigInteger): real; extensionmethod;
|
||||
begin
|
||||
var cnt := 0;
|
||||
var sum := 0bi;
|
||||
foreach var a in Self do
|
||||
begin
|
||||
sum += a;
|
||||
cnt += 1;
|
||||
end;
|
||||
if cnt <> 0 then
|
||||
Result := sum/cnt
|
||||
else Result := 0
|
||||
end;
|
||||
|
||||
/// Возвращает произведение элементов последовательности
|
||||
function Product(Self: sequence of BigInteger): BigInteger; extensionmethod;
|
||||
begin
|
||||
Result := 0bi;
|
||||
foreach var a in Self do
|
||||
Result += a
|
||||
end;
|
||||
|
||||
|
||||
/// Возвращает отсортированную по возрастанию последовательность
|
||||
function Sorted<T>(Self: sequence of T): sequence of T; extensionmethod;
|
||||
|
|
|
|||
Loading…
Reference in a new issue