Int32 - Max

Returns the larger of two 32-bit signed integers.

Try it

public static void Main()
{
    Int32  x = 7,   y = 57;
	
	// C# Extension Method: Int32 - Max
	Console.WriteLine("The maximum of {0,3} and {1,3} is {2}.", x, y, x.Max(y));
}

View Source
using System;

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