Method Median
Median(IEnumerable<decimal>)
Computes the median of a sequence of values.
public static decimal Median(this IEnumerable<decimal> source)
Parameters
sourceIEnumerable<decimal>The sequence of values.
Returns
- decimal
The median value.
Median(IEnumerable<decimal?>)
Computes the median of a sequence of values.
public static decimal? Median(this IEnumerable<decimal?> source)
Parameters
sourceIEnumerable<decimal?>The sequence of values.
Returns
- decimal?
The median value.
Median(IEnumerable<double>)
Computes the median of a sequence of values.
public static double Median(this IEnumerable<double> source)
Parameters
sourceIEnumerable<double>The sequence of values.
Returns
- double
The median value.
Median(IEnumerable<double?>)
Computes the median of a sequence of values.
public static double? Median(this IEnumerable<double?> source)
Parameters
sourceIEnumerable<double?>The sequence of values.
Returns
- double?
The median value.
Median(IEnumerable<float>)
Computes the median of a sequence of values.
public static float Median(this IEnumerable<float> source)
Parameters
sourceIEnumerable<float>The sequence of values.
Returns
- float
The median value.
Median(IEnumerable<float?>)
Computes the median of a sequence of values.
public static float? Median(this IEnumerable<float?> source)
Parameters
sourceIEnumerable<float?>The sequence of values.
Returns
- float?
The median value.
Median(IEnumerable<int>)
Computes the median of a sequence of values.
public static double Median(this IEnumerable<int> source)
Parameters
sourceIEnumerable<int>The sequence of values.
Returns
- double
The median value.
Median(IEnumerable<int?>)
Computes the median of a sequence of values.
public static double? Median(this IEnumerable<int?> source)
Parameters
sourceIEnumerable<int?>The sequence of values.
Returns
- double?
The median value.
Median(IEnumerable<long>)
Computes the median of a sequence of values.
public static double Median(this IEnumerable<long> source)
Parameters
sourceIEnumerable<long>The sequence of values.
Returns
- double
The median value.
Median(IEnumerable<long?>)
Computes the median of a sequence of values.
public static double? Median(this IEnumerable<long?> source)
Parameters
sourceIEnumerable<long?>The sequence of values.
Returns
- double?
The median value.
Median<TSource>(IEnumerable<TSource>, Func<TSource, decimal>)
Computes the median of a sequence of values.
public static decimal Median<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal> selector)
Parameters
sourceIEnumerable<TSource>A sequence of values to calculate the median of.
selectorFunc<TSource, decimal>A transform function to apply to each element.
Returns
- decimal
The median value.
Type Parameters
TSourceThe type of the elements in the source sequence.
Median<TSource>(IEnumerable<TSource>, Func<TSource, decimal?>)
Computes the median of a sequence of values.
public static decimal? Median<TSource>(this IEnumerable<TSource> source, Func<TSource, decimal?> selector)
Parameters
sourceIEnumerable<TSource>A sequence of values to calculate the median of.
selectorFunc<TSource, decimal?>A transform function to apply to each element.
Returns
- decimal?
The median value.
Type Parameters
TSourceThe type of the elements in the source sequence.
Median<TSource>(IEnumerable<TSource>, Func<TSource, double>)
Computes the median of a sequence of values.
public static double Median<TSource>(this IEnumerable<TSource> source, Func<TSource, double> selector)
Parameters
sourceIEnumerable<TSource>A sequence of values to calculate the median of.
selectorFunc<TSource, double>A transform function to apply to each element.
Returns
- double
The median value.
Type Parameters
TSourceThe type of the elements in the source sequence.
Median<TSource>(IEnumerable<TSource>, Func<TSource, double?>)
Computes the median of a sequence of values.
public static double? Median<TSource>(this IEnumerable<TSource> source, Func<TSource, double?> selector)
Parameters
sourceIEnumerable<TSource>A sequence of values to calculate the median of.
selectorFunc<TSource, double?>A transform function to apply to each element.
Returns
- double?
The median value.
Type Parameters
TSourceThe type of the elements in the source sequence.
Median<TSource>(IEnumerable<TSource>, Func<TSource, float>)
Computes the median of a sequence of values.
public static float Median<TSource>(this IEnumerable<TSource> source, Func<TSource, float> selector)
Parameters
sourceIEnumerable<TSource>A sequence of values to calculate the median of.
selectorFunc<TSource, float>A transform function to apply to each element.
Returns
- float
The median value.
Type Parameters
TSourceThe type of the elements in the source sequence.
Median<TSource>(IEnumerable<TSource>, Func<TSource, float?>)
Computes the median of a sequence of values.
public static float? Median<TSource>(this IEnumerable<TSource> source, Func<TSource, float?> selector)
Parameters
sourceIEnumerable<TSource>A sequence of values to calculate the median of.
selectorFunc<TSource, float?>A transform function to apply to each element.
Returns
- float?
The median value.
Type Parameters
TSourceThe type of the elements in the source sequence.
Median<TSource>(IEnumerable<TSource>, Func<TSource, int>)
Computes the median of a sequence of values.
public static double Median<TSource>(this IEnumerable<TSource> source, Func<TSource, int> selector)
Parameters
sourceIEnumerable<TSource>A sequence of values to calculate the median of.
selectorFunc<TSource, int>A transform function to apply to each element.
Returns
- double
The median value.
Type Parameters
TSourceThe type of the elements in the source sequence.
Median<TSource>(IEnumerable<TSource>, Func<TSource, int?>)
Computes the median of a sequence of values.
public static double? Median<TSource>(this IEnumerable<TSource> source, Func<TSource, int?> selector)
Parameters
sourceIEnumerable<TSource>A sequence of values to calculate the median of.
selectorFunc<TSource, int?>A transform function to apply to each element.
Returns
- double?
The median value.
Type Parameters
TSourceThe type of the elements in the source sequence.
Median<TSource>(IEnumerable<TSource>, Func<TSource, long>)
Computes the median of a sequence of values.
public static double Median<TSource>(this IEnumerable<TSource> source, Func<TSource, long> selector)
Parameters
sourceIEnumerable<TSource>A sequence of values to calculate the median of.
selectorFunc<TSource, long>A transform function to apply to each element.
Returns
- double
The median value.
Type Parameters
TSourceThe type of the elements in the source sequence.
Median<TSource>(IEnumerable<TSource>, Func<TSource, long?>)
Computes the median of a sequence of values.
public static double? Median<TSource>(this IEnumerable<TSource> source, Func<TSource, long?> selector)
Parameters
sourceIEnumerable<TSource>A sequence of values to calculate the median of.
selectorFunc<TSource, long?>A transform function to apply to each element.
Returns
- double?
The median value.
Type Parameters
TSourceThe type of the elements in the source sequence.