Tag Archives: Min

Make generic Min and Max methods in C#

This example shows how you can make generic Min and Max methods to find the minimum and maximum values in a sequence of parameters. The Math namespace’s Min and Max methods are very useful, but they have two big drawbacks. … Continue reading

Posted in algorithms, arrays, calculations, generic, methods | Tagged , , , , , , , , , , , , , , | Leave a comment

Use LINQ Min, Max, and Average extension methods in C#

This example shows how to use LINQ Min, Max, and Average extension methods to get the minimum, maximum, and average values from an array. In order to support LINQ, Microsoft added those extension methods and others. LINQ includes several useful … Continue reading

Posted in extension methods, LINQ, mathematics | Tagged , , , , , , , , , , , , | Leave a comment