C# BigInteger Abs
Description
BigInteger Abs
Gets the absolute value of a BigInteger
object.
Syntax
BigInteger.Abs
has the following syntax.
public static BigInteger Abs(
BigInteger value
)
Parameters
BigInteger.Abs
has the following parameters.
value
- A number.
Returns
BigInteger.Abs
method returns The absolute value of value.
Example
using System;/*ww w . j ava 2 s . c om*/
using System.IO;
using System.Numerics;
public class Example
{
public static void Main()
{
BigInteger number = BigInteger.Pow(Int32.MaxValue, 20) * BigInteger.MinusOne;
Console.WriteLine("The original value is {0}.", number);
Console.WriteLine(BigInteger.Abs(number));
}
}
The code above generates the following result.