This topic has not yet been rated - Rate this topic

Enumerable.Min Method

Returns the minimum value in a sequence of values.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method Static member Min(IEnumerable<Decimal>) Returns the minimum value in a sequence of Decimal values.
Public method Static member Min(IEnumerable<Nullable<Decimal>>) Returns the minimum value in a sequence of nullable Decimal values.
Public method Static member Min(IEnumerable<Double>) Returns the minimum value in a sequence of Double values.
Public method Static member Min(IEnumerable<Nullable<Double>>) Returns the minimum value in a sequence of nullable Double values.
Public method Static member Min<TSource>(IEnumerable<TSource>) Returns the minimum value in a generic sequence.
Public method Static member Min(IEnumerable<Int32>) Returns the minimum value in a sequence of Int32 values.
Public method Static member Min(IEnumerable<Nullable<Int32>>) Returns the minimum value in a sequence of nullable Int32 values.
Public method Static member Min(IEnumerable<Int64>) Returns the minimum value in a sequence of Int64 values.
Public method Static member Min(IEnumerable<Nullable<Int64>>) Returns the minimum value in a sequence of nullable Int64 values.
Public method Static member Min(IEnumerable<Nullable<Single>>) Returns the minimum value in a sequence of nullable Single values.
Public method Static member Min(IEnumerable<Single>) Returns the minimum value in a sequence of Single values.
Public method Static member Min<TSource>(IEnumerable<TSource>, Func<TSource, Decimal>) Invokes a transform function on each element of a sequence and returns the minimum Decimal value.
Public method Static member Min<TSource>(IEnumerable<TSource>, Func<TSource, Double>) Invokes a transform function on each element of a sequence and returns the minimum Double value.
Public method Static member Min<TSource>(IEnumerable<TSource>, Func<TSource, Int32>) Invokes a transform function on each element of a sequence and returns the minimum Int32 value.
Public method Static member Min<TSource>(IEnumerable<TSource>, Func<TSource, Int64>) Invokes a transform function on each element of a sequence and returns the minimum Int64 value.
Public method Static member Min<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Decimal>>) Invokes a transform function on each element of a sequence and returns the minimum nullable Decimal value.
Public method Static member Min<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Double>>) Invokes a transform function on each element of a sequence and returns the minimum nullable Double value.
Public method Static member Min<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Int32>>) Invokes a transform function on each element of a sequence and returns the minimum nullable Int32 value.
Public method Static member Min<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Int64>>) Invokes a transform function on each element of a sequence and returns the minimum nullable Int64 value.
Public method Static member Min<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Single>>) Invokes a transform function on each element of a sequence and returns the minimum nullable Single value.
Public method Static member Min<TSource>(IEnumerable<TSource>, Func<TSource, Single>) Invokes a transform function on each element of a sequence and returns the minimum Single value.
Public method Static member Min<TSource, TResult>(IEnumerable<TSource>, Func<TSource, TResult>) Invokes a transform function on each element of a generic sequence and returns the minimum resulting value.
Top
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
NaN is considered the absolute minimum
Note for floating point types like Double and Single (float) that can be NaN, when using Max<TSource> or Min<TSource> extension methods, the value of not a number (NaN) is considered to be the absolute minimum. Excerpt from the .NET Framework source:
                    // Normally NaN < anything is false, as is anything < NaN
                    // However, this leads to some irksome outcomes in Min and Max.
                    // If we use those semantics then Min(NaN, 5.0) is NaN, but
                    // Min(5.0, NaN) is 5.0!  To fix this, we impose a total
                    // ordering where NaN is smaller than every value, including
                    // negative infinity.