 | CondensedCollectionExtensionsAverage Method (CondensedCollectionNullableSingle) |
[This is preliminary documentation and is subject to change.]
Computes the average of a sequence of nullable float values. Optimized for a CondensedCollection.
Namespace:
Condensed.Linq
Assembly:
Condensed (in Condensed.dll) Version: 0.1.0.0 (0.1.0.0)
Syntaxpublic static Nullable<float> Average(
this CondensedCollection<Nullable<float>> source
)
<ExtensionAttribute>
Public Shared Function Average (
source As CondensedCollection(Of Nullable(Of Single))
) As Nullable(Of Single)
public:
[ExtensionAttribute]
static Nullable<float> Average(
CondensedCollection<Nullable<float>>^ source
)
[<ExtensionAttribute>]
static member Average :
source : CondensedCollection<Nullable<float32>> -> Nullable<float32>
Parameters
- source
- Type: CondensedCondensedCollectionNullableSingle
A CondensedCollection of nullable float values to calculate the average of.
Return Value
Type:
NullableSingleThe average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
CondensedCollectionNullableSingle. 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).
Exceptions
Remarks
This implementation of Average() is specialized for a CondensedCollection and tries to
take advantage of the CondensedCollection's knowledge of unique values in order to improve performance.
If you would rather use the normal LINQ extension method then cast the CondensedCollection to an
IListT
to use the
Average(IEnumerableNullableSingle) implementation.
See Also