EnumerableExtensionsSumTNumeric Method
Computes the sum of a sequence of numeric values.
Namespace: Jodosoft.NumericsAssembly: Jodosoft.Numerics (in Jodosoft.Numerics.dll) Version: 2.0
public static TNumeric Sum<TNumeric>(
this IEnumerable<TNumeric> source
)
where TNumeric : struct, new(), INumeric<TNumeric>
<ExtensionAttribute>
Public Shared Function Sum(Of TNumeric As {Structure, New, INumeric(Of TNumeric)}) (
source As IEnumerable(Of TNumeric)
) As TNumeric
public:
[ExtensionAttribute]
generic<typename TNumeric>
where TNumeric : value class, gcnew(), INumeric<TNumeric>
static TNumeric Sum(
IEnumerable<TNumeric>^ source
)
[<ExtensionAttribute>]
static member Sum :
source : IEnumerable<'TNumeric> -> 'TNumeric when 'TNumeric : struct, new() and INumeric<'TNumeric>
- source IEnumerableTNumeric
- A sequence of TNumeric values to calculate the sum of.
- TNumeric
- The type of numeric value to sum.
TNumericThe sum of the sequence of values.In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableTNumeric. 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).