Min(IEnumerable<Double>) vs Min<TSource>(IEnumerable<TSource>)

39 views Asked by At

Say I have a List<double> called nums. If I want to get the minimum of nums, which is a sequence of doubles, I have two options:

  1. use Min(IEnumerable<Double>) -- i.e. do double minNum = nums.Min();
  2. use Min<TSource>(IEnumerable<TSource>) -- i.e. do double minNums = nums.Min<double>();

What's the difference? Why does C# offer both of these options instead of just offering just the generic version?

0

There are 0 answers