Computes the sum of the sequence of
BigInteger values that are obtained by invoking a transform function on each element of the input sequence.
If the source sequence represents an infinite set or series, this will never return!
Namespace: SequencesAssembly: Sequences (in Sequences.dll) Version: 1.0.1.0 (1.0.1)
Syntax public static BigInteger Sum<TSource>(
this ISequence<TSource> source,
Func<TSource, BigInteger> selector
)
public static BigInteger Sum<TSource>(
this ISequence<TSource> source,
Func<TSource, BigInteger> selector
)
<ExtensionAttribute>
Public Shared Function Sum(Of TSource) (
source As ISequence(Of TSource),
selector As Func(Of TSource, BigInteger)
) As BigInteger
<ExtensionAttribute>
Public Shared Function Sum(Of TSource) (
source As ISequence(Of TSource),
selector As Func(Of TSource, BigInteger)
) As BigInteger
public:
[ExtensionAttribute]
generic<typename TSource>
static BigInteger Sum(
ISequence<TSource>^ source,
Func<TSource, BigInteger>^ selector
)
public:
[ExtensionAttribute]
generic<typename TSource>
static BigInteger Sum(
ISequence<TSource>^ source,
Func<TSource, BigInteger>^ selector
)
static member Sum :
source : ISequence<'TSource> *
selector : Func<'TSource, BigInteger> -> BigInteger
static member Sum :
source : ISequence<'TSource> *
selector : Func<'TSource, BigInteger> -> BigInteger
Parameters
- source
- Type: Sequences ISequence TSource
A sequence of values that are used to calculate a sum.
- selector
- Type: System Func TSource, BigInteger
Type Parameters - TSource
- The type of the elements of source.
Return Value
Type:
BigIntegerA transform function to apply to each element.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
ISequence TSource . 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).
See Also