PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.MedianExtensions Class Reference

Provides .Median() extension methods for numeric collections. More...

Static Public Member Functions

static decimal Median (this IEnumerable< byte > collection)
 Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.
static decimal Median (this IEnumerable< int > collection)
 Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.
static decimal Median (this IEnumerable< uint > collection)
 Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.
static decimal Median (this IEnumerable< long > collection)
 Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.
static decimal Median (this IEnumerable< ulong > collection)
 Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.
static decimal Median (this IEnumerable< float > collection)
 Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.
static decimal Median (this IEnumerable< double > collection)
 Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.
static decimal Median (this IEnumerable< decimal > collection)
 Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.

Detailed Description

Provides .Median() extension methods for numeric collections.

Member Function Documentation

◆ Median() [1/8]

decimal PeanutButter.Utils.MedianExtensions.Median ( this IEnumerable< byte > collection)
static

Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.

Parameters
collection
Returns
Exceptions
ArgumentException

◆ Median() [2/8]

decimal PeanutButter.Utils.MedianExtensions.Median ( this IEnumerable< decimal > collection)
static

Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.

Parameters
collection
Returns
Exceptions
ArgumentException

◆ Median() [3/8]

decimal PeanutButter.Utils.MedianExtensions.Median ( this IEnumerable< double > collection)
static

Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.

Parameters
collection
Returns
Exceptions
ArgumentException

◆ Median() [4/8]

decimal PeanutButter.Utils.MedianExtensions.Median ( this IEnumerable< float > collection)
static

Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.

Parameters
collection
Returns
Exceptions
ArgumentException

◆ Median() [5/8]

decimal PeanutButter.Utils.MedianExtensions.Median ( this IEnumerable< int > collection)
static

Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.

Parameters
collection
Returns
Exceptions
ArgumentException

◆ Median() [6/8]

decimal PeanutButter.Utils.MedianExtensions.Median ( this IEnumerable< long > collection)
static

Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.

Parameters
collection
Returns
Exceptions
ArgumentException

◆ Median() [7/8]

decimal PeanutButter.Utils.MedianExtensions.Median ( this IEnumerable< uint > collection)
static

Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.

Parameters
collection
Returns
Exceptions
ArgumentException

◆ Median() [8/8]

decimal PeanutButter.Utils.MedianExtensions.Median ( this IEnumerable< ulong > collection)
static

Produces the median value from a non-empty collection or throws for an empty collection The median is defined as the middle value in a sorted collection or the average of the two middle values in a sorted collection with an even number of items in it.

Parameters
collection
Returns
Exceptions
ArgumentException

The documentation for this class was generated from the following file:
  • source/Utils/PeanutButter.Utils/MedianExtensions.cs