Int32 Sum
Sums vector values.
Returns: Int32 - the sum of all calling object elements.
Examples
using Dew.Math;
using Dew.Math.Units;
namespace Dew.Examples
{
void Example()
{
TVecInt a;
MtxVecInt.CreateIt(out a);
try
{
a.SetIt(new int[] {1,3,-2});
int s = a.Sum(); // s = 2
}
finally
{
MtxVecInt.FreeIt(ref a);
}
}
}
Indexed: Int32 Sum(Int32 Index, Int32 Len)
Returns the sum of calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | Int32 | start index |
| 2 | Len | Int32 | element count |
Returns: Int32
Remarks:
An exception is raised if array borders are overrun/underrun.