EnumerableExtensionsAverageTNumeric Method
Computes the average of a sequence of numeric values.
Namespace: Jodosoft.NumericsAssembly: Jodosoft.Numerics (in Jodosoft.Numerics.dll) Version: 2.0
public static TNumeric Average<TNumeric>(
this IEnumerable<TNumeric> source
)
where TNumeric : struct, new(), INumeric<TNumeric>
<ExtensionAttribute>
Public Shared Function Average(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 Average(
IEnumerable<TNumeric>^ source
)
[<ExtensionAttribute>]
static member Average :
source : IEnumerable<'TNumeric> -> 'TNumeric when 'TNumeric : struct, new() and INumeric<'TNumeric>
- source IEnumerableTNumeric
- A sequence of TNumeric values to calculate the average of.
- TNumeric
- The type of numeric value to average.
TNumericThe average 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).