 | EnumerableExtensionsRangeT Method |
Calculates the range of values of a list of at least 2 values.
Namespace:
TestHelperExtensions
Assembly:
CBI.TestHelperExtensions (in CBI.TestHelperExtensions.dll) Version: 2.1.0.1
Syntaxpublic static double Range<T>(
this IEnumerable<T> values
)
<ExtensionAttribute>
Public Shared Function Range(Of T) (
values As IEnumerable(Of T)
) As Double
public:
[ExtensionAttribute]
generic<typename T>
static double Range(
IEnumerable<T>^ values
)
[<ExtensionAttribute>]
static member Range :
values : IEnumerable<'T> -> float
Parameters
- values
- Type: System.Collections.GenericIEnumerableT
A list of numeric values for which the range is to be determined.
Type Parameters
- T
- Any numeric data type.
Return Value
Type:
DoubleA double containing the total range of the list of values.
Usage 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).
RemarksThe return type of this method has to be double rather than T because
the range may cross the maximum positive value for the specified data type. For example,
a list of Integers, that goes from -Int32.MaxValue to Int32.MaxValue would have a range
of 2*Int32.MaxValue, which is clearly greater then the maximum allowable value of an Int32.
See Also