mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 02:59:28 +02:00
* added sumInt
git-svn-id: trunk@2380 -
This commit is contained in:
parent
0c050527ca
commit
e58e92c4fa
@ -304,6 +304,8 @@ function mean(const data : array of float) : float;
|
||||
function sum(const data : array of float) : float;
|
||||
function mean(const data : PFloat; Const N : longint) : float;
|
||||
function sum(const data : PFloat; Const N : Longint) : float;
|
||||
function sumInt(const data : PInt64;Const N : longint) : Int64;
|
||||
function sumInt(const data : array of Int64) : Int64;
|
||||
function sumofsquares(const data : array of float) : float;
|
||||
function sumofsquares(const data : PFloat; Const N : Integer) : float;
|
||||
{ calculates the sum and the sum of squares of data }
|
||||
@ -752,6 +754,23 @@ function sum(const data : PFloat;Const N : longint) : float;
|
||||
sum:=sum+data[i];
|
||||
end;
|
||||
|
||||
function sumInt(const data : PInt64;Const N : longint) : Int64;
|
||||
|
||||
var
|
||||
i : longint;
|
||||
|
||||
begin
|
||||
sumInt:=0;
|
||||
for i:=0 to N-1 do
|
||||
sumInt:=sumInt+data[i];
|
||||
end;
|
||||
|
||||
function sumInt(const data : array of Int64) : Int64;
|
||||
|
||||
begin
|
||||
Result:=SumInt(@Data[0],High(Data)+1);
|
||||
end;
|
||||
|
||||
function sumofsquares(const data : array of float) : float;
|
||||
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user