Computes the sum of the sequence of values.
Namespace:
Extreme.Mathematics
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static T Sum<T>(
this IEnumerable<T> source
)
<ExtensionAttribute>
Public Shared Function Sum(Of T) (
source As IEnumerable(Of T)
) As T
public:
[ExtensionAttribute]
generic<typename T>
static T Sum(
IEnumerable<T>^ source
)
[<ExtensionAttribute>]
static member Sum :
source : IEnumerable<'T> -> 'T
Parameters
- source
- Type: System.Collections.GenericIEnumerableT
A sequence of values.
Type Parameters
- T
- The element type of source.
Return Value
Type:
TUsage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Reference