System.Numerics 4.0.0.0 System.ValueType System.IComparable System.IComparable<System.Numerics.BigInteger> System.IEquatable<System.Numerics.BigInteger> System.IFormattable

The type is an immutable type that represents an arbitrarily large integer whose value in theory has no upper or lower bounds. The members of the type closely parallel those of other integral types (the , , , , , , , and types). This type differs from the other integral types in the dnprdnshort, which have a range indicated by their MinValue and MaxValue properties.

Because the type is immutable (see Mutability and the BigInteger Structure) and because it has no upper or lower bounds, an can be thrown for any operation that causes a value to grow too large.

## Instantiating a BigInteger Object

You can instantiate a object in several ways:

You can use the new keyword and provide any integral or floating-point value as a parameter to the constructor. (Floating-point values are truncated before they are assigned to the .) The following example illustrates how to use the new keyword to instantiate values.

code reference: System.Numerics.BigInteger.Class#1

You can declare a variable and assign it a value just as you would any numeric type, as long as that value is an integral type. The following example uses assignment to create a value from an .

code reference: System.Numerics.BigInteger.Class#2

You can assign a decimal or floating-point value to a object if you cast the value or convert it first. The following example explicitly casts (in C#) or converts (in Visual Basic) a and a value to a .

code reference: System.Numerics.BigInteger.Class#3

These methods enable you to instantiate a object whose value is in the range of one of the existing numeric types only. You can instantiate a object whose value can exceed the range of the existing numeric types in one of three ways:

You can use the new keyword and provide a byte array of any size to the constructor. For example:

code reference: System.Numerics.BigInteger.Class#4

You can call the or methods to convert the string representation of a number to a . For example:

code reference: System.Numerics.BigInteger.Class#5

You can call a static (Shared in Visual Basic) method that performs some operation on a numeric expression and returns a calculated result. The following example does this by cubing and assigning the result to a .

code reference: System.Numerics.BigInteger.Class#6

The uninitialized value of a is .

## Performing Operations on BigInteger Values

You can use a instance as you would use any other integral type. overloads the standard numeric operators to enable you to perform basic mathematical operations such as addition, subtraction, division, multiplication, subtraction, negation, and unary negation. You can also use the standard numeric operators to compare two values with each other. Like the other integral types, also supports the bitwise And, Or, XOr, left shift, and right shift operators. For languages that do not support custom operators, the structure also provides equivalent methods for performing mathematical operations. These include , , , , , and several others.

Many members of the structure correspond directly to members of the other integral types. In addition, adds members such as the following:

, which returns a value that indicates the sign of a value.

, which returns the absolute value of a value.

, which returns both the quotient and remainder of a division operation.

, which returns the greatest common divisor of two values.

Many of these additional members correspond to the members of the class, which provides the functionality to work with the primitive numeric types.

## Mutability and the BigInteger Structure

The following example instantiates a object and then increments its value by one.

code reference: System.Numerics.BigInteger.Class.Mutability#1

Although this example appears to modify the value of the existing object, this is not the case. objects are immutable, which means that internally, the common language runtime actually creates a new object and assigns it a value one greater than its previous value. This new object is then returned to the caller.

The other numeric types in the .NET Framework are also immutable. However, because the type has no upper or lower bounds, its values can grow extremely large and have a measurable impact on performance.

Although this process is transparent to the caller, it does incur a performance penalty. In some cases, especially when repeated operations are performed in a loop on very large values, that performance penalty can be significant. For example, in the following example, an operation is performed repetitively up to a million times, and a value is incremented by one every time the operation succeeds.

code reference: System.Numerics.BigInteger.Class.Mutability#2

In such a case, you can improve performance by performing all intermediate assignments to an variable. The final value of the variable can then be assigned to the object when the loop exits. The following example provides an illustration.

code reference: System.Numerics.BigInteger.Class.Mutability#3

## Working with Byte Arrays and Hexadecimal Strings

If you convert values to byte arrays, or if you convert byte arrays to values, you must consider the order of bytes. The structure expects the individual bytes in a byte array to appear in little-endian order (that is, the lower-order bytes of the value precede the higher-order bytes). You can round-trip a value by calling the method and then passing the resulting byte array to the constructor, as the following example shows.

code reference: System.Numerics.BigInteger.Class.ByteAndHex#1

To instantiate a value from a byte array that represents a value of some other integral type, you can pass the integral value to the method, and then pass the resulting byte array to the constructor. The following example instantiates a value from a byte array that represents an value.

code reference: System.Numerics.BigInteger.Class.ByteAndHex#2

The structure assumes that negative values are stored by using two's complement representation. Because the structure represents a numeric value with no fixed length, the constructor always interprets the most significant bit of the last byte in the array as a sign bit. To prevent the constructor from confusing the two's complement representation of a negative value with the sign and magnitude representation of a positive value, positive values in which the most significant bit of the last byte in the byte array would ordinarily be set should include an additional byte whose value is 0. For example, 0xC0 0xBD 0xF0 0xFF is the little-endian hexadecimal representation of either -1,000,000 or 4,293,967,296. Because the most significant bit of the last byte in this array is on, the value of the byte array would be interpreted by the constructor as -1,000,000. To instantiate a whose value is positive, a byte array whose elements are 0xC0 0xBD 0xF0 0xFF 0x00 must be passed to the constructor. The following example illustrates this.

code reference: System.Numerics.BigInteger.Class.ByteAndHex#3

Byte arrays created by the method from positive values include this extra zero-value byte. Therefore, the structure can successfully round-trip values by assigning them to, and then restoring them from, byte arrays, as the following example shows.

code reference: System.Numerics.BigInteger.Class.ByteAndHex#4

However, you may need to add this additional zero-value byte to byte arrays that are created dynamically by the developer or that are returned by methods that convert unsigned integers to byte arrays (such as , , and ).

When parsing a hexadecimal string, the and methods assume that if the most significant bit of the first byte in the string is set, or if the first hexadecimal digit of the string represents the lower four bits of a byte value, the value is represented by using two's complement representation. For example, both "FF01" and "F01" represent the decimal value -255. To differentiate positive from negative values, positive values should include a leading zero. The relevant overloads of the method, when they are passed the "X" format string, add a leading zero to the returned hexadecimal string for positive values. This makes it possible to round-trip values by using the and methods, as the following example shows.

code reference: System.Numerics.BigInteger.Class.ByteAndHex#5

However, the hexadecimal strings created by calling the ToString methods of the other integral types or the overloads of the method that include a parameter do not indicate the sign of the value or the source data type from which the hexadecimal string was derived. Successfully instantiating a value from such a string requires some additional logic. The following example provides one possible implementation.

code reference: System.Numerics.BigInteger.Class.ByteAndHex#6

Represents an arbitrarily large signed integer.

- Constructor
  4.0.0.0
  System.CLSCompliant(false)

  The individual bytes in the array should be in little-endian order, from lowest-order byte to highest-order byte. For example, the numeric value 1,000,000,000,000 is represented as shown in the following table:

  Hexadecimal string

  E8D4A51000

  Byte array (lowest index first)

  00 10 A5 D4 E8 00

  Most methods that convert numeric values to byte arrays, such as and , return byte arrays in little-endian order.

  The constructor expects positive values in the byte array to use sign-and-magnitude representation, and negative values to use two's complement representation. In other words, if the highest-order bit of the highest-order byte in is set, the resulting value is negative. Depending on the source of the byte array, this may cause a positive value to be misinterpreted as a negative value. Byte arrays are typically generated in the following ways:

  By calling the method. Because this method returns a byte array with the highest-order bit of the highest-order byte in the array set to zero for positive values, there is no chance of misinterpreting a positive value as negative. Unmodified byte arrays created by the method always successfully round-trip when they are passed to the constructor.

  By calling the method and passing it a signed integer as a parameter. Because signed integers handle both sign-and-magnitude representation and two's complement representation, there is no chance of misinterpreting a positive value as negative.

  By calling the method and passing it an unsigned integer as a parameter. Because unsigned integers are represented by their magnitude only, positive values can be misinterpreted as negative values. To prevent this misinterpretation, you can add a zero-byte value to the end of the array. The example in the next section provides an illustration.

  By creating a byte array either dynamically or statically without necessarily calling any of the previous methods, or by modifying an existing byte array. To prevent positive values from being misinterpreted as negative values, you can add a zero-byte value to the end of the array.

  If is an empty array, the new object is initialized to a value of . If is null, the constructor throws an .

  Initializes a new instance of the structure using the values in a byte array.

  An array of byte values in little-endian order.
- Constructor
  4.0.0.0

  The result of calling this constructor is identical to explicitly assigning a value to a variable.

  Calling this constructor can cause data loss; any fractional part of is truncated when instantiating a object.

  Initializes a new instance of the structure using a value.

  A decimal number.
- Constructor
  4.0.0.0

  Any fractional part of the parameter is truncated when instantiating a object.

  Because of the lack of precision of the data type, calling this constructor can cause data loss.

  The value that results from calling this constructor is identical to the value that results from explicitly assigning a value to a .

  Initializes a new instance of the structure using a double-precision floating-point value.

  A double-precision floating-point value.
- Constructor
  4.0.0.0

  There is no loss of precision when instantiating a object by using this constructor.

  The value that results from calling this constructor is identical to the value that results from assigning an value to a .

  The structure does not include constructors with a parameter of type , , , or . However, the type supports the implicit conversion of 8-bit and 16-bit signed and unsigned integers to signed 32-bit integers. As a result, this constructor is called if is any one of these four integral types.

  Initializes a new instance of the structure using a 32-bit signed integer value.

  A 32-bit signed integer.
- Constructor
  4.0.0.0

  There is no loss of precision when instantiating a object by using this constructor.

  The value that results from calling this constructor is identical to the value that results from assigning an value to a .

  Initializes a new instance of the structure using a 64-bit signed integer value.

  A 64-bit signed integer.
- Constructor
  4.0.0.0

  Any fractional part of the parameter is truncated when instantiating a object.

  Because of the lack of precision of the data type, calling this constructor can result in data loss.

  The value that results from calling this constructor is identical to the value that results from explicitly assigning a value to a .

  Initializes a new instance of the structure using a single-precision floating-point value.

  A single-precision floating-point value.
- Constructor
  4.0.0.0
  System.CLSCompliant(false)

  There is no loss of precision when instantiating a using this constructor.

  The value that results from calling this constructor is identical to the value that results from assigning a value to a .

  Initializes a new instance of the structure using an unsigned 32-bit integer value.

  An unsigned 32-bit integer value.
- Constructor
  4.0.0.0
  System.CLSCompliant(false)

  There is no loss of precision when instantiating a using this constructor.

  The value that results from calling this constructor is identical to the value that results from assigning a value to a .

  Initializes a new instance of the structure with an unsigned 64-bit integer value.

  An unsigned 64-bit integer.
- Method
  4.0.0.0
  System.Numerics.BigInteger ``

  The absolute value of a number is that number without its sign, as shown in the following table.

  parameter

  Return value

  >= 0

  < 0

  * -1

  The method is equivalent to the method for the primitive numeric types.

  Gets the absolute value of a object.

  The absolute value of .

  A number.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  Languages that do not support operator overloading or custom operators can use the method to perform addition using values.

  The method is a useful substitute for the addition operator when instantiating a variable by assigning it a sum that results from addition, as shown in the following example.

  code reference: System.Numerics.BigInteger.OperationMethods#2

  Adds two values and returns the result.

  The sum of and .

  The first value to add. The second value to add.
- Method
  4.0.0.0
  System.Int32 `` ``

  Although the type has no fixed range, comparisons of values are not characterized by the lack of precision that characterizes the comparison of floating-point numbers. The following example compares two values that differ by one and that each have 1,896 digits. The method correctly reports that the two values are not equal.

  code reference: System.Numerics.BigInteger.Compare#1

  Compares two values and returns an integer that indicates whether the first value is less than, equal to, or greater than the second value.

  A signed integer that indicates the relative values of and , as shown in the following table.

  Value

  Condition

  Less than zero

  is less than .

  Zero

  equals .

  Greater than zero

  is greater than .

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Int32 ``

  If is a , , , , , or value, it is implicitly converted to an value when the method is called.

  Compares this instance to a signed 64-bit integer and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the signed 64-bit integer.

  A signed integer value that indicates the relationship of this instance to , as shown in the following table.

  Return value

  Description

  Less than zero

  The current instance is less than .

  Zero

  The current instance equals .

  Greater than zero

  The current instance is greater than .

  The signed 64-bit integer to compare.
- Method
  4.0.0.0
  System.Int32 ``

  This overload of the method implements the method. It is used by generic collection objects to order the items in the collection.

  Compares this instance to a second and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object.

  A signed integer value that indicates the relationship of this instance to , as shown in the following table.

  Return value

  Description

  Less than zero

  The current instance is less than .

  Zero

  The current instance equals .

  Greater than zero

  The current instance is greater than .

  The object to compare.
- Method
  4.0.0.0
  System.Int32 ``

  This overload of the method implements the method. It is used by non-generic collection objects to order the items in the collection.

  The parameter must be one of the following:

  An object whose run-time type is .

  An variable whose value is null. If the value of the parameter is null, the method returns 1, which indicates that that the current instance is greater than .

  Compares this instance to a specified object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object.

  A signed integer that indicates the relationship of the current instance to the parameter, as shown in the following table.

  Return value

  Description

  Less than zero

  The current instance is less than .

  Zero

  The current instance equals .

  Greater than zero

  The current instance is greater than , or the parameter is null.

  The object to compare.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Int32 `` To be added.

  Compares this instance to an unsigned 64-bit integer and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the unsigned 64-bit integer.

  A signed integer that indicates the relative value of this instance and , as shown in the following table.

  Return value

  Description

  Less than zero

  The current instance is less than .

  Zero

  The current instance equals .

  Greater than zero

  The current instance is greater than .

  The unsigned 64-bit integer to compare.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The method performs integer division; any remainder that results from the division is discarded. To perform integer division while preserving the remainder, call the method. To retrieve only the remainder, call the method.

  The method can be used by languages that do not support operator overloading. Its behavior is identical to division using the division operator.

  Divides one value by another and returns the result.

  The quotient of the division.

  The value to be divided. The value to divide by.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` `` `` To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Boolean ``

  If is a , , , , , or value, it is implicitly converted to an value when the method is called.

  To determine the relationship between the two objects instead of just testing for equality, call the method.

  Returns a value that indicates whether the current instance and a signed 64-bit integer have the same value.

  true if the signed 64-bit integer and the current instance have the same value; otherwise, false.

  The signed 64-bit integer value to compare.
- Method
  4.0.0.0
  System.Boolean ``

  This method implements the interface and performs slightly better than because it does not have to convert the parameter to a object.

  To determine the relationship between the two objects instead of just testing for equality, call the method.

  Returns a value that indicates whether the current instance and a specified object have the same value.

  true if this object and have the same value; otherwise, false.

  The object to compare.
- Method
  4.0.0.0
  System.Boolean ``

  If the parameter is not a value, but it is a data type for which an implicit conversion is defined, the method converts to a value before it performs the comparison. If is not a value and cannot be implicitly converted to , the method returns false. If no conversion from to a value exists, the method does not throw an exception; instead, it returns false.

  To determine the relationship between the two objects instead of just testing for equality, call the method.

  Returns a value that indicates whether the current instance and a specified object have the same value.

  true if the parameter is a object or a type capable of implicit conversion to a value, and its value is equal to the value of the current object; otherwise, false.

  The object to compare.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean ``

  To determine the relationship between the two objects instead of just testing for equality, call the method.

  Returns a value that indicates whether the current instance and an unsigned 64-bit integer have the same value.

  true if the current instance and the unsigned 64-bit integer have the same value; otherwise, false.

  The unsigned 64-bit integer to compare.
- Method
  4.0.0.0
  System.Int32 To be added.

  Returns the hash code for the current object.

  A 32-bit signed integer hash code.

- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The greatest common divisor is the largest number into which the two values can be divided without returning a remainder.

  If the and parameters are non-zero numbers, the method always returns at least a value of 1 because all numbers can be divided by 1. If either parameter is zero, the method returns the absolute value of the non-zero parameter. If both values are zero, the method returns zero.

  Computing the greatest common divisor of very large values of and can be a very time-consuming operation.

  The value returned by the method is always positive regardless of the sign of the and parameters.

  Finds the greatest common divisor of two values.

  The greatest common divisor of and .

  The first value. The second value.
- Property
  4.0.0.0
  System.Boolean To be added.

  This property is a convenience feature that indicates whether a value is evenly divisible by two. It is equivalent to the following expression:

  [C#]

  `value % 2 == 0;`

  [Visual Basic]

  `value Mod 2 = 0`

  If the value of the current object is , the property returns true.

  Indicates whether the value of the current object is an even number.

- Property
  4.0.0.0
  System.Boolean To be added.

  This property offers significantly better performance than other comparisons with one, such as thisBigInteger.Equals(BigInteger.One).

  Indicates whether the value of the current object is .

- Property
  4.0.0.0
  System.Boolean To be added.

  This property determines whether a value has a single non-zero bit set. This means that it returns true if the value of the current object is 1 (that is, 20) or any greater power of two. It returns false if the value of the current object is 0.

  Indicates whether the value of the current object is a power of two.

- Property
  4.0.0.0
  System.Boolean To be added.

  This property offers significantly better performance than BigInteger.Equals(BigInteger.Zero).

  Indicates whether the value of the current object is .

- Method
  4.0.0.0
  System.Double ``

  The parameter is specified as a base 10 number.

  The precise return value of this method depends on the sign of , as the following table shows.

  Sign of parameter

  Return value

  Positive

  The natural logarithm of ; that is, ln , or log e .

  Zero

  .

  Negative

  .

  To calculate the base 10 logarithm of a value, call the method. To calculate the logarithm of a number in another base, call the method.

  You can find the square root of a number by calling the method along with the method. Note that the result is if the result is greater than . The following example calculates the square root of each element in an array of values.

  code reference: System.Numerics.BigInteger.Log#1

  This method corresponds to the method for the primitive numeric types.

  Returns the natural (base e) logarithm of a specified number.

  The natural (base e) logarithm of , as shown in the table in the Remarks section.

  The number whose logarithm is to be found.
- Method
  4.0.0.0
  System.Double `` ``

  The and parameters are specified as base 10 numbers.

  The precise return value of the method depends on the sign of and on the sign and value of , as the following table shows.

  parameter

  parameter

  Return value

  > 0

  (0 < < 1) -or-( > 1)

  logbaseValue()

  < 0

  (any value)

  (any value)

  < 0

  != 1

  = 0

  != 1

  =

  (any value)

  =

  (any value)

  = 1

  = 0

  0 < < 1

  = 0

  > 1

  = 1

  = 0

  0

  = 1

  =

  0

  To calculate the base 10 logarithm of a value, call the method. To calculate the natural logarithm of a number, call the method.

  This method corresponds to the method for the primitive numeric types.

  Returns the logarithm of a specified number in a specified base.

  The base logarithm of , as shown in the table in the Remarks section.

  A number whose logarithm is to be found. The base of the logarithm.
- Method
  4.0.0.0
  System.Double ``

  The parameter is specified as a base 10 number.

  The precise return value of the method depends on the sign of , as the following table shows.

  Sign of value parameter

  Return value

  Positive

  The base 10 log of ; that is, log10.

  Zero

  .

  Negative

  .

  To calculate the natural logarithm of a value, call the method. To calculate the logarithm of a number in another base, call the method.

  This method corresponds to the method for the primitive numeric types.

  Returns the base 10 logarithm of a specified number.

  The base 10 logarithm of , as shown in the table in the Remarks section.

  A number whose logarithm is to be found.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  This method corresponds to the method for primitive numeric types.

  Returns the larger of two values.

  The or parameter, whichever is larger.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  This method corresponds to the method for primitive numeric types.

  Returns the smaller of two values.

  The or parameter, whichever is smaller.

  The first value to compare. The second value to compare.
- Property
  4.0.0.0
  System.Numerics.BigInteger To be added.

  The property is used to compare a value to -1 or to assign -1 to a object.

  Gets a value that represents the number negative one (-1).

- Method
  4.0.0.0
  System.Numerics.BigInteger `` `` ``

  The method evaluates the following expression:

  (baseValue ^ exponent) Mod modulus

  To perform exponentiation on values without modulus division, use the method.

  Performs modulus division on a number raised to the power of another number.

  The remainder after dividing exponent by .

  The number to raise to the power. The exponent to raise by. The number by which to divide raised to the power.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The method is implemented for languages that do not support operator overloading. Its behavior is identical to multiplication using the multiplication operator. In addition, the method is a useful substitute for the multiplication operator when instantiating a variable by assigning it a product that results from multiplication, as shown in the following example.

  code reference: System.Numerics.BigInteger.OperationMethods#1

  If necessary, this method automatically performs implicit conversion of other integral types to objects. This is illustrated in the example in the next section, where the method is passed two values.

  Returns the product of two values.

  The product of the and parameters.

  The first number to multiply. The second number to multiply.
- Method
  4.0.0.0
  System.Numerics.BigInteger ``

  Negation obtains the additive inverse of a number. The additive inverse of a number is a number that produces a value of zero when it is added to the original number.

  The method is implemented for languages that do not support custom operators. Its behavior is identical to negation using the unary negation operator. In addition, the method is a useful substitute for the negation operator when instantiating a variable, as shown in the following example.

  code reference: System.Numerics.BigInteger.OperationMethods#4

  Negates a specified value.

  The result of the parameter multiplied by negative one (-1).

  The value to negate.
- Property
  4.0.0.0
  System.Numerics.BigInteger To be added.

  The property is usually used to compare a value to 1 or to assign 1 to a object.

  Gets a value that represents the number one (1).

- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The method defines the addition operation for values. It enables code such as the following:

  code reference: System.Numeric.BigInteger.Class#12

  Languages that do not support custom operators can call the method instead.

  Adds the values of two specified objects.

  The sum of and .

  The first value to add. The second value to add.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The method defines the bitwise And operation for values. The bitwise And operation sets a result bit only if the corresponding bits in and are also set, as shown in the following table.

  Bit in

  Bit in

  Bit in result

  0

  0

  0

  1

  0

  0

  1

  1

  1

  0

  1

  0

  The method enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#1

  The method performs the bitwise And operation on two values as if they were both in two's complement representation with virtual sign extension.

  Performs a bitwise And operation on two values.

  The result of the bitwise And operation.

  The first value. The second value.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The method defines the bitwise Or operation for values. The bitwise Or operation sets a result bit only if either or both of the corresponding bits in and are set, as shown in the following table.

  Bit in

  Bit in

  Bit in result

  0

  0

  0

  1

  0

  1

  1

  1

  1

  0

  1

  1

  The method enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#2

  The method performs the bitwise Or operation on two values as if they were both in two's complement representation with virtual sign extension.

  Performs a bitwise Or operation on two values.

  The result of the bitwise Or operation.

  The first value. The second value.
- Method
  4.0.0.0
  System.Numerics.BigInteger ``

  The method defines the decrement operation for values. It enables code such as the following:

  code reference: System.Numeric.BigInteger.Class#17

  Languages that do not support custom operators can call the method instead. For example:

  code reference: System.Numerics.BigInteger.Operators#3

  Because objects are immutable, the operator creates a new object whose value is one less than the object represented by . This means that repeated calls to may be expensive.

  Decrements a value by 1.

  The value of the parameter decremented by 1.

  The value to decrement.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The method defines the division operation for values. It enables code such as the following:

  code reference: System.Numeric.BigInteger.Class#13

  Languages that do not support custom operators and operator overloading can call the method instead.

  Divides a specified value by another specified value by using integer division.

  The integral result of the division.

  The value to be divided. The value to divide by.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the equality comparison operation for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#4

  Languages that do not support custom operators can call the instance method instead.

  If is a , , , , , or value, it is implicitly converted to an value when the operation is performed.

  Returns a value that indicates whether a signed long integer value and a value are equal.

  true if the and parameters have the same value; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the equality comparison operation for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#5

  Languages that do not support custom operators can call the instance method instead.

  If is a , , , , , or value, it is implicitly converted to an value when the operation is performed.

  Returns a value that indicates whether a value and a signed long integer value are equal.

  true if the and parameters have the same value; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the equality operator for values. It enables code such as the following:

  code reference: System.Numeric.BigInteger.Class#19

  Languages that do not support custom operators can call the instance method instead.

  Returns a value that indicates whether the values of two objects are equal.

  true if the and parameters have the same value; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean `` ``

  The method defines the equality comparison operation for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#6

  Languages that do not support custom operators can call the instance method instead.

  Returns a value that indicates whether a value and an unsigned long integer value are equal.

  true if the and parameters have the same value; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean `` ``

  The method defines the equality comparison operation for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#7

  Languages that do not support custom operators can call the instance method instead.

  Returns a value that indicates whether an unsigned long integer value and a value are equal.

  true if the and parameters have the same value; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The result of a bitwise exclusive Or operation is true if the values of the two bits are different; otherwise, it is false. The following table illustrates the exclusive Or operation.

  Bit x in

  Bit x in

  Return value

  0

  0

  0

  0

  1

  1

  1

  0

  1

  1

  1

  0

  The method enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#8

  The method performs the bitwise exclusive Or operation on two values as if they were both in two's complement representation with virtual sign extension.

  Performs a bitwise exclusive Or (XOr) operation on two values.

  The result of the bitwise Or operation.

  The first value. The second value.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Byte `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Decimal `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Double `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Int16 `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Int32 `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Int64 `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Single `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the greater than operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#9

  Languages that do not support custom operators can call the instance method instead. Some languages can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#10

  If is a , , , , , or value, it is implicitly converted to an value when the operation is performed.

  Returns a value that indicates whether a 64-bit signed integer is greater than a value.

  true if is greater than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the greater than operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#11

  Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#12

  If is a , , , , , or value, it is implicitly converted to an value when the operation is performed.

  Returns a value that indicates whether a is greater than a 64-bit signed integer value.

  true if is greater than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the greater than operator for values. It enables code such as the following:

  code reference: System.Numeric.BigInteger.Class#20

  Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows.

  code reference: System.Numeric.BigInteger.Class#21

  Returns a value that indicates whether a value is greater than another value.

  true if is greater than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean `` ``

  The method defines the operation of the greater than operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#13

  Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#14

  Returns a value that indicates whether a value is greater than a 64-bit unsigned integer.

  true if is greater than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean `` ``

  The method defines the operation of the greater than operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#15

  Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#16

  Returns a value that indicates whether a value is greater than a 64-bit unsigned integer.

  true if is greater than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the greater than or equal to operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#17

  Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#18

  If is a , , , , , or value, it is implicitly converted to an value when the operation is performed.

  Returns a value that indicates whether a 64-bit signed integer is greater than or equal to a value.

  true if is greater than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the greater than or equal to operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#19

  Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#20

  If is a , , , , , or value, it is implicitly converted to an value when the operation is performed.

  Returns a value that indicates whether a value is greater than or equal to a 64-bit signed integer value.

  true if is greater than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the greater than or equal to operator for values. It enables code such as the following:

  code reference: System.Numeric.BigInteger.Class#22

  Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows.

  code reference: System.Numeric.BigInteger.Class#23

  Returns a value that indicates whether a value is greater than or equal to another value.

  true if is greater than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean `` ``

  The method defines the operation of the greater than or equal to operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#21

  Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#22

  Returns a value that indicates whether a value is greater than or equal to a 64-bit unsigned integer value.

  true if is greater than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean `` ``

  The method defines the operation of the greater than or equal to operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#23

  Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#24

  Returns a value that indicates whether a 64-bit unsigned integer is greater than or equal to a value.

  true if is greater than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Numerics.BigInteger `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Numerics.BigInteger `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Numerics.BigInteger `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Numerics.BigInteger `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Numerics.BigInteger ``

  The method defines the increment operation for values. It enables code such as the following:

  code reference: System.Numeric.BigInteger.Class#24

  Some languages (such as Visual Basic) that lack an increment operator or do not support operator overloading can call the method directly, as the following example shows.

  code reference: System.Numeric.BigInteger.Class#25

  Because objects are immutable, the operator creates a new object whose value is one more than the object represented by . Therefore, repeated calls to may be expensive.

  Increments a value by 1.

  The value of the parameter incremented by 1.

  The value to increment.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the inequality operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#25

  Languages that do not support custom operators can test for inequality by using one of the following techniques:

  Calling the instance method, which indicates the relationship between a and a signed long integer value.

  Calling the instance method and reversing its value.

  If is a , , , , , or value, it is implicitly converted to an value when the operation is performed.

  Returns a value that indicates whether a 64-bit signed integer and a value are not equal.

  true if and are not equal; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the inequality operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#26

  Languages that do not support custom operators can test for inequality by using one of the following techniques:

  Calling the method, which indicates the relationship between a and a signed long integer value.

  Calling the method and reversing its value.

  If is a , , , , , or value, it is implicitly converted to an value when the operation is performed.

  Returns a value that indicates whether a value and a 64-bit signed integer are not equal.

  true if and are not equal; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the inequality operator for values. It enables code such as the following:

  code reference: System.Numeric.BigInteger.Class#26

  Languages that do not support custom operators can test for inequality by using one of the following techniques:

  Calling the method, which indicates the relationship between two objects.

  Calling the method and reversing its value.

  Returns a value that indicates whether two objects have different values.

  true if and are not equal; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean `` ``

  The method defines the operation of the inequality operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#27

  Languages that do not support custom operators can test for inequality by using one of the following techniques:

  Calling the method, which indicates the relationship between a and an unsigned long integer value.

  Calling the method and reversing its value.

  Returns a value that indicates whether a value and a 64-bit unsigned integer are not equal.

  true if and are not equal; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean `` ``

  The method defines the operation of the inequality operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#28

  Languages that do not support custom operators can test for inequality by using one of the following techniques:

  Calling the method, which indicates the relationship between a and an unsigned long integer value.

  Calling the method and reversing its value.

  Returns a value that indicates whether a 64-bit unsigned integer and a value are not equal.

  true if and are not equal; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The method defines the operation of the bitwise left-shift operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#29

  Unlike the bitwise left-shift operation with integer primitives, the method preserves the sign of the original value.

  Languages that do not support custom operators can perform a bitwise left-shift operation by multiplying by BigInteger.Pow(2, ). The following example shows that the results are identical to the results of using this operator.

  code reference: System.Numerics.BigInteger.Operators#30

  Shifts a value a specified number of bits to the left.

  A value that has been shifted to the left by the specified number of bits.

  The value whose bits are to be shifted. The number of bits to shift to the left.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the less than operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#31

  Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#32

  If is a , , , , , or value, it is implicitly converted to an value when the operation is performed.

  Returns a value that indicates whether a 64-bit signed integer is less than a value.

  true if is less than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the less than operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#33

  Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#34

  If is a , , , , , or value, it is implicitly converted to an value when the operation is performed.

  Returns a value that indicates whether a value is less than a 64-bit signed integer.

  true if is less than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the less than operator for values. It enables code such as the following:

  code reference: System.Numeric.BigInteger.Class#27

  Languages that do not support custom operators can call the method instead. Some languages can also call the method directly, as the following example shows.

  code reference: System.Numeric.BigInteger.Class#28

  Returns a value that indicates whether a value is less than another value.

  true if is less than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean `` ``

  The method defines the operation of the less than operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#35

  Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#36

  Returns a value that indicates whether a value is less than a 64-bit unsigned integer.

  true if is less than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean `` ``

  The method defines the operation of the less than operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#37

  Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#38

  Returns a value that indicates whether a 64-bit unsigned integer is less than a value.

  true if is less than ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the less than or equal to operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#39

  Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#40

  If is a , , , , , or value, it is implicitly converted to an value when the operation is performed.

  Returns a value that indicates whether a 64-bit signed integer is less than or equal to a value.

  true if is less than or equal to ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the less than or equal to operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#41

  Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#42

  If is a , , , , , or value, it is implicitly converted to an value when the operation is performed.

  Returns a value that indicates whether a value is less than or equal to a 64-bit signed integer.

  true if is less than or equal to ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the less than or equal to operator for values. It enables code such as the following:

  code reference: System.Numeric.BigInteger.Class#29

  Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows.

  code reference: System.Numeric.BigInteger.Class#30

  Returns a value that indicates whether a value is less than or equal to another value.

  true if is less than or equal to ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean `` ``

  The method defines the operation of the less than or equal to operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#43

  Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#44

  Returns a value that indicates whether a value is less than or equal to a 64-bit unsigned integer.

  true if is less than or equal to ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean `` ``

  The method defines the operation of the less than or equal to operator for values. It enables code such as the following:

  code reference: System.Numerics.BigInteger.Operators#45

  Languages that do not support custom operators can call the method instead. They can also call the method directly, as the following example shows.

  code reference: System.Numerics.BigInteger.Operators#46

  Returns a value that indicates whether a 64-bit unsigned integer is less than or equal to a value.

  true if is less than or equal to ; otherwise, false.

  The first value to compare. The second value to compare.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The method defines the operation of the modulus operator for values. It enables code such as the following:

  code reference: System.Numeric.BigInteger.Class#31

  Languages that do not support custom operators can call the method instead.

  The sign of the value returned by the modulus operation depends on the sign of : If is positive, the modulus operation returns a positive result; if it is negative, the modulus operation returns a negative result. The behavior of the modulus operation with values is identical to the modulus operation with other integral types.

  Returns the remainder that results from division with two specified values.

  The remainder that results from the division.

  The value to be divided. The value to divide by.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The method defines the operation of the multiplication operator for values. It enables code such as the following:

  code reference: System.Numeric.BigInteger.Class#11

  Multiplies two specified values.

  The product of and .

  The first value to multiply. The second value to multiply.
- Method
  4.0.0.0
  System.Numerics.BigInteger ``

  The method defines the operation of the bitwise one's complement operator for values. The bitwise one's complement operator reverses each bit in a numeric value. That is, bits in that are 0 are set to 1 in the result, and bits that are 1 are set to 0 in the result. The method enables code such as the following:

  code reference: System.Numerics.BigInteger.OnesComplement#1

  Languages that do not support custom operators may be able to call the method directly to perform a bitwise one's complement operation. For example:

  code reference: System.Numerics.BigInteger.OnesComplement#2

  Returns the bitwise one's complement of a value.

  The bitwise one's complement of .

  An integer value.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The method defines the operation of the bitwise right-shift operator for values. It enables code such as the following:

  code reference: System.Numeric.BigInteger.Operators#47

  Languages that do not support custom operators can perform a bitwise right-shift operation by dividing by BigInteger.Pow(2, ) and subtracting 1 times for negative values. The following example shows that the results are identical to the results of using this operator.

  code reference: System.Numerics.BigInteger.Operators#48

  If is greater than or equal to the number of bits in a positive value, the result of the right-shift operation is . If is greater than the number of bits in a negative value, the result of the right-shift operation is .

  Shifts a value a specified number of bits to the right.

  A value that has been shifted to the right by the specified number of bits.

  The value whose bits are to be shifted. The number of bits to shift to the right.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The method defines the operation of the subtraction operator for values. It enables code such as the following:

  code reference: System.Numeric.BigInteger.Class#14

  Languages that do not support custom operators can call the method instead.

  Subtracts a value from another value.

  The result of subtracting from .

  The value to subtract from (the minuend). The value to subtract (the subtrahend).
- Method
  4.0.0.0
  System.Numerics.BigInteger ``

  The method defines the operation of the unary negation operator (or the additive inverse operator) for values. The operation produces a value that results in 0 (zero) when it is added to the original number. Languages that do not support custom operators can call the method instead.

  Negates a specified BigInteger value.

  The result of the parameter multiplied by negative one (-1).

  The value to negate.
- Method
  4.0.0.0
  System.Numerics.BigInteger ``

  The method defines the operation of the unary positive operator for values.

  Returns the value of the operand. (The sign of the operand is unchanged.)

  The value of the operand.

  An integer value.
- Method
  4.0.0.0
  System.Numerics.BigInteger ``

  The parameter should be the string representation of a number in the following form.

  [ws][sign]digits[ws]

  Elements in square brackets ([ and ]) are optional. The following table describes each element.

  Element

  Description

  ws

  Optional white space.

  sign

  An optional sign. Valid sign characters are determined by the and properties of the current culture.

  digits

  A sequence of digits ranging from 0 to 9. Any leading zeros are ignored.

  The string specified by the parameter is interpreted by using the style. It cannot contain any group separators or decimal separator, and it cannot have a decimal portion.

  The parameter is parsed by using the formatting information in a object that is initialized for the current system culture. For more information, see . To parse a string by using the formatting information of a specific culture, use the method.

  If you use the method to round-trip the string representation of a value that was output by the method, you should use the method with the "R" format specifier to generate the string representation of the value. Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value.

  Converts the string representation of a number to its equivalent.

  A value that is equivalent to the number specified in the parameter.

  A string that contains the number to convert.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The parameter defines the style elements (such as white space, the positive or negative sign symbol, the group separator symbol, or the decimal point symbol) that are allowed in the parameter for the parse operation to succeed. must be a combination of bit flags from the enumeration. The parameter makes this method overload useful when contains the string representation of a hexadecimal value, when the number system (decimal or hexadecimal) represented by is known only at run time, or when you want to disallow white space or a sign symbol in .

  Depending on the value of , the parameter may include the following elements:

  [ws][$][sign][digits,]digits[.fractional_digits][E[sign]exponential_digits][ws]

  If includes , the parameter may contain the following elements:

  [ws]hexdigits[ws]

  Elements in square brackets ([ and ]) are optional. The following table describes each element.

  Element

  Description

  ws

  Optional white space. White space can appear at the start of if includes the flag, and it can appear at the end of if includes the flag.

  $

  A culture-specific currency symbol. Its position in the string is defined by the and properties of the current culture. The current culture's currency symbol can appear in if includes the flag.

  sign

  An optional sign. The sign can appear at the start of if includes the flag, and it can appear at the end of if includes the flag. Parentheses can be used in to indicate a negative value if includes the flag.

  digits

  fractional_digits

  exponential_digits

  A sequence of digits from 0 through 9. For fractional_digits, only the digit 0 is valid.

  ,

  A culture-specific group separator symbol. The current culture's group separator can appear in if includes the flag.

  .

  A culture-specific decimal point symbol. The current culture's decimal point symbol can appear in if includes the flag. Only the digit 0 can appear as a fractional digit for the parse operation to succeed; if fractional_digits includes any other digit, a is thrown.

  E

  The "e" or "E" character, which indicates that the value is represented in exponential (scientific) notation. The parameter can represent a number in exponential notation if includes the flag.

  hexdigits

  A sequence of hexadecimal digits from 0 through f, or 0 through F.

  A string with digits only (which corresponds to the style) always parses successfully. Most of the remaining members control elements that may be present, but are not required to be present, in the input string. The following table indicates how individual members affect the elements that may be present in .

  NumberStyles value

  Elements permitted in in addition to digits

  The digits element only.

  The decimal point (.) and fractional-digits elements.

  The "e" or "E" character, which indicates exponential notation, along with exponential_digits.

  The ws element at the start of .

  The ws element at the end of .

  The sign element at the start of .

  The sign element at the end of .

  The sign element in the form of parentheses enclosing the numeric value.

  The group separator (,) element.

  The currency ($) element.

  All elements. However, cannot represent a hexadecimal number or a number in exponential notation.

  The ws element at the start or end of , sign at the start of , and the decimal point (.) symbol. The parameter can also use exponential notation.

  The , , group separator (,), and decimal point (.) elements.

  All elements. However, cannot represent a hexadecimal number.

  If you use the method to round-trip the string representation of a value that was output by the method, you should use the method with the "R" format specifier to generate the string representation of the value. Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value.

  Unlike the other values, which allow for, but do not require, the presence of particular style elements in , the style value means that the individual numeric characters in are always interpreted as hexadecimal characters. Valid hexadecimal characters are 0-9, A-F, and a-f. The only other flags that can be combined with the parameter are and . (The enumeration includes a composite number style, , that includes both white-space flags.)

  If is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as 0x or &h) that differentiates it as a hexadecimal number. This causes the conversion to fail.

  If is a hexadecimal string, the method interprets as a negative number stored by using two's complement representation if its first two hexadecimal digits are greater than or equal to 0x80. In other words, the method interprets the highest-order bit of the first byte in as the sign bit. To make sure that a hexadecimal string is correctly interpreted as a positive number, the first digit in must have a value of zero. For example, the method interprets 0x80 as a negative value, but it interprets either 0x080 or 0x0080 as a positive value. The following example illustrates the difference between hexadecimal strings that represent negative and positive values.

  code reference: System.Numerics.BigInteger.Parse#3

  The parameter is parsed by using the formatting information in a object that is initialized for the current system culture. To specify the culture whose formatting information is used for the parse operation, call the overload.

  Converts the string representation of a number in a specified style to its equivalent.

  A value that is equivalent to the number specified in the parameter.

  A string that contains a number to convert. A bitwise combination of the enumeration values that specify the permitted format of .
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The parameter should be the string representation of a number in the following form:

  [ws][sign]digits[ws]

  Elements in square brackets ([ and ]) are optional. The following table describes each element.

  Element

  Description

  ws

  Optional white space.

  sign

  An optional sign. Valid sign characters are determined by the and properties of the object that is returned by the object's method.

  digits

  A sequence of digits ranging from 0 to 9. Any leading zeros are ignored.

  The string specified by the parameter is interpreted using the style. It cannot contain any group separators or decimal separator, and it cannot have a decimal portion.

  If you use the method to round-trip the string representation of a value that was output by the method, you should use the method with the "R" format specifier to generate the string representation of the value. Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value.

  The parameter is an implementation whose method returns a object that provides culture-specific formatting information. When the method is invoked, it calls the parameter's method and passes it a object that represents the type. The method then returns the object that provides information about the format of the parameter. There are three ways to use the parameter to supply custom formatting information to the parse operation:

  You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture.

  You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.)

  You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information.

  If is null, the formatting of is interpreted based on the object of the current culture.

  Converts the string representation of a number in a specified culture-specific format to its equivalent.

  A value that is equivalent to the number specified in the parameter.

  A string that contains a number to convert. An object that provides culture-specific formatting information about .
- Method
  4.0.0.0
  System.Numerics.BigInteger `` `` ``

  The parameter defines the style elements (such as white space, the positive or negative sign symbol, the group separator symbol, or the decimal point symbol) that are allowed in the parameter for the parse operation to succeed. must be a combination of bit flags from the enumeration. The parameter makes this method overload useful when contains the string representation of a hexadecimal value, when the number system (decimal or hexadecimal) represented by is known only at run time, or when you want to disallow white space or a sign symbol in .

  Depending on the value of , the parameter may include the following elements:

  [ws][$][sign][digits,]digits[.fractional_digits][E[sign]exponential_digits][ws]

  If includes , the parameter may include the following elements:

  [ws]hexdigits[ws]

  Elements in square brackets ([ and ]) are optional. The following table describes each element.

  Element

  Description

  ws

  Optional white space. White space can appear at the start of if includes the flag, and it can appear at the end of if includes the flag.

  $

  A culture-specific currency symbol. Its position in the string is defined by the and properties of the culture indicated by the parameter. The current culture's currency symbol can appear in if includes the flag.

  sign

  An optional sign. The sign can appear at the start of if includes the flag, and it can appear at the end of if includes the flag. Parentheses can be used in to indicate a negative value if includes the flag.

  digits

  fractional_digits

  exponential_digits

  A sequence of digits from 0 through 9. For fractional_digits, only the digit 0 is valid.

  ,

  A culture-specific group separator symbol. The group separator symbol of the culture specified by can appear in if includes the flag.

  .

  A culture-specific decimal point symbol. The decimal point symbol of the culture designated by can appear in if includes the flag. Only the digit 0 can appear as a fractional digit for the parse operation to succeed; if fractional_digits includes any other digit, a is thrown.

  E

  The "e" or "E" character, which indicates that the value is represented in exponential (scientific) notation. The parameter can represent a number in exponential notation if includes the flag.

  hexdigits

  A sequence of hexadecimal digits from 0 through f, or 0 through F.

  A string with digits only (which corresponds to the style) always parses successfully. Most of the remaining members control elements that may be present, but are not required to be present, in the input string. The following table indicates how individual members affect the elements that may be present in .

  NumberStyles value

  Elements permitted in value in addition to digits

  The digits element only.

  The decimal point (.) and fractional-digits elements.

  The "e" or "E" character, which indicates exponential notation. along with exponential_digits.

  The ws element at the start of .

  The ws element at the end of .

  The sign element at the start of .

  The sign element at the end of .

  The sign element in the form of parentheses enclosing the numeric value.

  The group separator (,) element.

  The currency ($) element.

  All elements. However, cannot represent a hexadecimal number or a number in exponential notation.

  The ws element at the start or end of , sign at the start of , and the decimal point (.) symbol. The parameter can also use exponential notation.

  The , , group separator (,), and decimal point (.) elements.

  All elements. However, cannot represent a hexadecimal number.

  If you use the method to round-trip the string representation of a value that was output by the method, you should use the method with the "R" format specifier to generate the string representation of the value. Otherwise, the string representation of the preserves only the 50 most significant digits of the original value, and data may be lost when you use the method to restore the value.

  Unlike the other values, which allow for but do not require the presence of particular style elements in , the style value means that the individual numeric characters in are always interpreted as hexadecimal characters. Valid hexadecimal characters are 0-9, A-F, and a-f. The only other flags that can be combined with the parameter are and . (The enumeration includes a composite number style, , that includes both white-space flags.)

  If is the string representation of a hexadecimal number, it cannot be preceded by any decoration (such as 0x or &h) that differentiates it as a hexadecimal number. This causes the conversion to fail.

  If is a hexadecimal string, the method interprets as a negative number stored by using two's complement representation if its first two hexadecimal digits are greater than or equal to 0x80. In other words, the method interprets the highest-order bit of the first byte in as the sign bit. To make sure that a hexadecimal string is correctly interpreted as a positive number, the first digit in must have a value of zero. For example, the method interprets 0x80 as a negative value, but it interprets either 0x080 or 0x0080 as a positive value. The following example illustrates the difference between hexadecimal strings that represent negative and positive values.

  code reference: System.Numerics.BigInteger.Parse#3

  The parameter is an implementation. Its method returns a object that provides culture-specific information about the format of . Typically, can be any one of the following:

  A object that represents the culture that provides numeric formatting information. Its method returns the object that provides numeric formatting information.

  A object that provides formatting information. (Its implementation of just returns itself.)

  A custom object that implements and uses the method to instantiate and return the object that provides formatting information.

  If is null, the object for the current culture is used.

  Converts the string representation of a number in a specified style and culture-specific format to its equivalent.

  A value that is equivalent to the number specified in the parameter.

  A string that contains a number to convert. A bitwise combination of the enumeration values that specify the permitted format of . An object that provides culture-specific formatting information about .
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The method returns 1 if the value of the exponent parameter is 0, or if the values of both the and parameters are 0. If is 1, the method returns . If is negative, the method returns a negative result.

  This method corresponds to the method for primitive numeric types.

  Raises a value to the power of a specified value.

  The result of raising to the power.

  The number to raise to the power. The exponent to raise by.
- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  The sign of the remainder is the sign of the parameter.

  The method is implemented for languages that do not support custom operators. Its behavior is identical to division using the modulus operator.

  If necessary, the method automatically performs implicit conversion of other integral types to objects before it performs the modulus operation.

  Performs integer division on two values and returns the remainder.

  The remainder after dividing by .

  The value to be divided. The value to divide by.
- Property
  4.0.0.0
  System.Int32 To be added.

  The property is equivalent to the method for the primitive numeric types.

  Gets a number that indicates the sign (negative, positive, or zero) of the current object.

- Method
  4.0.0.0
  System.Numerics.BigInteger `` ``

  Languages that do not support custom operators can use the method to perform subtraction using values.

  The method is a useful substitute for the subtraction operator when instantiating a variable by assigning it the difference that results from subtraction, as shown in the following example.

  code reference: System.Numerics.BigInteger.OperationMethods#3

  Subtracts one value from another and returns the result.

  The result of subtracting from .

  The value to subtract from (the minuend). The value to subtract (the subtrahend).
- Method
  4.0.0.0
  System.Byte[]

  The individual bytes in the array returned by this method appear in little-endian order. That is, the lower-order bytes of the value precede the higher-order bytes. The first byte of the array reflects the first eight bits of the value, the second byte reflects the next eight bits, and so on. For example, the value 1024, or 0x0400, is stored as the following array of two bytes:

  Element

  Byte value

  0

  0x00

  1

  0x04

  Negative values are written to the array using two's complement representation in the most compact form possible. For example, -1 is represented as a single byte whose value is 0xFF instead of as an array with multiple elements, such as 0xFF, 0xFF or 0xFF, 0xFF, 0xFF, 0xFF.

  Because two's complement representation always interprets the highest-order bit of the last byte in the array (the byte at position - 1) as the sign bit, the method returns a byte array with an extra element whose value is zero to disambiguate positive values that could otherwise be interpreted as having their sign bits set. For example, the value 120 or 0x78 is represented as a single-byte array: 0x78. However, 128, or 0x80, is represented as a two-byte array: 0x80, 0x00.

  You can round-trip a value by storing it to a byte array and then restoring it using the constructor.

  If your code modifies the value of individual bytes in the array returned by this method before it restores the value, you must make sure that you do not unintentionally change the sign bit. For example, if your modifications increase a positive value so that the highest-order bit in the last element of the byte array becomes set, you can add a new byte whose value is zero to the end of the array.

  Converts a value to a byte array.

  The value of the current object converted to an array of bytes.

- Method
  4.0.0.0
  System.String

  The method formats a value in the default ("G", or general) format of the current culture. If you want to specify a different format or culture, use the other overloads of the method, as follows:

  To use format

  For culture

  Use the overload

  Default ("G") format

  A specific culture

  A specific format

  Default (current) culture

  A specific format

  A specific culture

  The string representation of the value includes a negative sign if its value is negative, and a sequence of digits ranging from 0 to 9 without leading zeros. The negative sign is defined by the object for the current culture.

  The method supports 50 decimal digits of precision. That is, if the value has more than 50 digits, only the 50 most significant digits are preserved in the output string; all other digits are replaced with zeros.

  Converts the numeric value of the current object to its equivalent string representation.

  The string representation of the current value.

- Method
  4.0.0.0
  System.String ``

  The method formats a value in the default ("G", or general) format by using the object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the method, as follows:

  To use format

  For culture

  Use the overload

  Default ("G") format

  Default (current) culture

  A specific format

  Default (current) culture

  A specific format

  A specific culture

  The method supports 50 decimal digits of precision. That is, if the value has more than 50 digits, only the 50 most significant digits are preserved in the output string; all other digits are replaced with zeros.

  The parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. If is null, the value is formatted using the object of the current culture. The only property of the object that controls the string representation of the value using the general format specifier is , which defines the character that represents the negative sign.

  The parameter can be one of the following:

  A object that represents the culture that supplies formatting information.

  The object that supplies formatting information.

  A custom object that implements . Its method returns the object that supplies formatting information.

  Converts the numeric value of the current object to its equivalent string representation by using the specified culture-specific formatting information.

  The string representation of the current value in the format specified by the parameter.

  An object that supplies culture-specific formatting information.
- Method
  4.0.0.0
  System.String ``

  The method formats a value in a specified format by using a object that represents the conventions of the current culture. If you want to use the default ("G", or general) format or specify a different culture, use the other overloads of the method, as follows:

  To use format

  For culture

  Use the overload

  Default ("G") format

  Default (current) culture

  Default ("G") format

  A specific culture

  A specific format

  A specific culture

  The parameter can be any valid standard numeric format specifier, or any combination of custom numeric format specifiers. If is equal to or is null, the return value of the current object is formatted with the general format specifier ("G"). If is any other value, the method throws a .

  In most cases, the method supports 50 decimal digits of precision. That is, if the value has more than 50 digits, only the 50 most significant digits are preserved in the output string; all other digits are replaced with zeros. However, supports the "R" standard format specifier, which is intended to round-trip numeric values. The string returned by the method with the "R" format string preserves the whole value and can then be parsed with the or method to restore its original value without any loss of data. The following example illustrates that a string output using the "R" format string can then be parsed by the method without any data loss.

  code reference: System.Numerics.BigInteger.ToString#2

  The .NET Framework provides extensive formatting support, which is described in greater detail in the following formatting topics:

  For more information about numeric format specifiers, see Standard Numeric Format Strings and Custom Numeric Format Strings.

  For more information about support for formatting in the .NET Framework, see Formatting Overview.

  The format of the returned string is determined by the object for the current culture. Depending on the parameter, this object controls symbols such as the negative sign, the group separator, and the decimal point symbol in the output string. To provide formatting information for cultures other than the current culture, call the overload.

  Converts the numeric value of the current object to its equivalent string representation by using the specified format.

  The string representation of the current value in the format specified by the parameter.

  A standard or custom numeric format string.
- Method
  4.0.0.0
  System.String `` ``

  The method formats a value in a specified format by using the object of a specified culture. If you want to use default format or culture settings, use the other overloads of the method, as follows:

  To use format

  For culture

  Use the overload

  Default ("G") format

  Default (current) culture

  Default ("G") format

  A specific culture

  A specific format

  Default (current) culture

  The parameter can be any valid standard numeric format specifier, or any combination of custom numeric format specifiers. If is equal to or is null, the return value of the current object is formatted with the general format specifier ("G"). If is any other value, the method throws a .

  In most cases, the method supports 50 decimal digits of precision. That is, if the value has more than 50 digits, only the 50 most significant digits are preserved in the output string; all other digits are replaced with zeros. However, supports the "R" standard format specifier, which is intended to round-trip numeric values. The string returned by the method with the "R" format string preserves the whole value and can then be parsed with the or method to restore its original value without any loss of data.

  The .NET Framework provides extensive formatting support, which is described in greater detail in the following formatting topics:

  For more information about numeric format specifiers, see Standard Numeric Format Strings and Custom Numeric Format Strings.

  For more information about support for formatting in the .NET Framework, see Formatting Overview.

  The parameter is an implementation. Its method returns a object that provides culture-specific information about the format of the string returned by this method. When the method is invoked, it calls the parameter's method and passes it a object that represents the type. The method then returns the object that provides information for formatting the parameter, such as the negative sign symbol, the group separator symbol, or the decimal point symbol. There are three ways to use the parameter to supply formatting information to the method:

  You can pass a object that represents the culture that supplies formatting information. Its method returns the object that provides numeric formatting information for that culture.

  You can pass the actual object that provides numeric formatting information. (Its implementation of just returns itself.)

  You can pass a custom object that implements . Its method instantiates and returns the object that provides formatting information.

  If is null, the formatting of the returned string is based on the object of the current culture.

  Converts the numeric value of the current object to its equivalent string representation by using the specified format and culture-specific format information.

  The string representation of the current value as specified by the and parameters.

  A standard or custom numeric format string. An object that supplies culture-specific formatting information.
- Method
  4.0.0.0
  System.Boolean `` `` To be added. To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.Boolean `` `` `` `` To be added. To be added. To be added. To be added. To be added. To be added. To be added.
- Property
  4.0.0.0
  System.Numerics.BigInteger To be added.

  The object returned by this property provides a convenient source of a zero value for use in assignments and comparisons.

  Gets a value that represents the number 0 (zero).