Single - Min
Returns the smaller of two single-precision floating-point numbers.
public static void Main() { float x = 7.5f, y = 57.2f; // C# Extension Method: Single - Min Console.WriteLine("The minimum of {0} and {1} is {2}.", x, y, x.Min(y)); }
View Source
using System; public static partial class Extensions { /// <summary> /// Returns the smaller of two single-precision floating-point numbers. /// </summary> /// <param name="val1">The first of two single-precision floating-point numbers to compare.</param> /// <param name="val2">The second of two single-precision floating-point numbers to compare.</param> /// <returns>Parameter or , whichever is smaller. If , , or both and are equal to , is returned.</returns> public static Single Min(this Single val1, Single val2) { return Math.Min(val1, val2); } }