last works ...
This commit is contained in:
@@ -8909,6 +8909,43 @@ bool Contains(
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Calculate a Buffer's Sum ...
|
||||
template <typename T>
|
||||
double GetSum(
|
||||
T &buffer[], // the Buffer which required to search
|
||||
int start = 0, // Start Index
|
||||
int count = 0 // Count for Search
|
||||
)
|
||||
{
|
||||
//
|
||||
double result = 0;
|
||||
|
||||
//
|
||||
T tmp[];
|
||||
int tmpCount = Copy(
|
||||
start,
|
||||
count,
|
||||
buffer,
|
||||
tmp
|
||||
//
|
||||
);
|
||||
if (tmpCount <= 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Calculate Summary ...
|
||||
for (int i = 0; i < tmpCount; i++)
|
||||
{
|
||||
result += buffer[i];
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Calculate a Buffer's Average ...
|
||||
template <typename T>
|
||||
|
||||
Reference in New Issue
Block a user