Int64 - Abs

Returns the absolute value of a 64-bit signed integer.

Try it

public static void Main()
{
	Int64[] values = { Int64.MaxValue, 15000, 10000, 2500, 1, 0, -7, -30, -365, -1000, -2500, -10000, -15000, -Int64.MaxValue };
	
	Console.WriteLine("{0,-30}{1,-30}","Int32", "Abs");
    Console.WriteLine("{0,-30}{1,-30}","-----", "---");
	
  	foreach (Int64 value in values)
	{
		// C# Extension Method: Int64 - Abs
    	Console.WriteLine("{0,-30}{1,-30}", value, value.Abs());
	}
}

View Source
using System;

public static partial class Extensions
{
    /// <summary>
    ///     Returns the absolute value of a 64-bit signed integer.
    /// </summary>
    /// <param name="value">A number that is greater than , but less than or equal to .</param>
    /// <returns>A 64-bit signed integer, x, such that 0 ? x ?.</returns>
    public static Int64 Abs(this Int64 value)
    {
        return Math.Abs(value);
    }
}