Byte - Min

Returns the smaller of two 8-bit unsigned integers.

Try it

public static void Main()
{
	string str = "{0}: The greater of {1} and {2} is {3}.";
	
	byte xByte1 = 1, xByte2 = 51;
	
	// C# Extension Method: Byte - Min
	var result = xByte1.Min(xByte2);
	
	Console.WriteLine(str, "Byte", xByte1, xByte2, result);
}

View Source
using System;

public static partial class Extensions
{
    /// <summary>
    ///     Returns the smaller of two 8-bit unsigned integers.
    /// </summary>
    /// <param name="val1">The first of two 8-bit unsigned integers to compare.</param>
    /// <param name="val2">The second of two 8-bit unsigned integers to compare.</param>
    /// <returns>Parameter  or , whichever is smaller.</returns>
    public static Byte Min(this Byte val1, Byte val2)
    {
        return Math.Min(val1, val2);
    }
}