BigInteger Structure

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents an arbitrarily large signed integer.

Namespace:  Microsoft.SolverFoundation.Common
Assembly:  Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)

Syntax

'Declaration
<CLSCompliantAttribute(True)> _
Public Structure BigInteger _
    Implements IComparable, IComparable(Of BigInteger),  _
    IEquatable(Of BigInteger), IComparable(Of Integer), IEquatable(Of Integer),  _
    IComparable(Of UInteger), IEquatable(Of UInteger), IComparable(Of Long),  _
    IEquatable(Of Long), IComparable(Of ULong), IEquatable(Of ULong),  _
    IComparable(Of Double), IEquatable(Of Double)
[CLSCompliantAttribute(true)]
public struct BigInteger : IComparable, 
    IComparable<BigInteger>, IEquatable<BigInteger>, IComparable<int>, 
    IEquatable<int>, IComparable<uint>, IEquatable<uint>, IComparable<long>, 
    IEquatable<long>, IComparable<ulong>, IEquatable<ulong>, IComparable<double>, 
    IEquatable<double>
[CLSCompliantAttribute(true)]
public value class BigInteger : IComparable, 
    IComparable<BigInteger>, IEquatable<BigInteger>, IComparable<int>, 
    IEquatable<int>, IComparable<unsigned int>, IEquatable<unsigned int>, 
    IComparable<long long>, IEquatable<long long>, IComparable<unsigned long long>, 
    IEquatable<unsigned long long>, IComparable<double>, IEquatable<double>
[<Sealed>]
[<CLSCompliantAttribute(true)>]
type BigInteger =  
    struct
        interface IComparable
        interface IComparable<BigInteger>
        interface IEquatable<BigInteger>
        interface IComparable<int>
        interface IEquatable<int>
        interface IComparable<uint32>
        interface IEquatable<uint32>
        interface IComparable<int64>
        interface IEquatable<int64>
        interface IComparable<uint64>
        interface IEquatable<uint64>
        interface IComparable<float>
        interface IEquatable<float>
    end
JScript supports the use of structures, but not the declaration of new ones.

The BigInteger type exposes the following members.

Properties

  Name Description
Public property AbsoluteValue Gets the absolute value.
Public property BitCount Gets the count of the number of bits in an integer.
Public property IsEven Gets a value indicating whether a value is exactly divisible by two.
Public property IsOne Gets a value indicating whether a value is equal to one.
Public property IsPowerOfTwo Gets a value indicating whether a value is a power of two (2x).
Public property IsZero Gets a value indicating whether a value is equal to zero.
Public property Sign Gets a value that represents the sign of a value.

Top

Methods

  Name Description
Public methodStatic member CompareFractions Compares integer fractions.
Public methodStatic member CompareFractionToBigInteger Compares a fraction with a big integer.
Public methodStatic member CompareFractionToLong Compares a fraction to a long.
Public methodStatic member CompareFractionToUlong Compares a fraction to an unsigned long.
Public method CompareTo(Double) Compares a big integer to a double.
Public method CompareTo(Int32) Compares a big integer to a 32-bit integer.
Public method CompareTo(Int64) Compares a big integer to a long.
Public method CompareTo(Object) Compares a big integer to a value.
Public method CompareTo(UInt32) Compares a big integer to an unsigned integer.
Public method CompareTo(UInt64) Compares a big integer to an unsigned long.
Public method CompareTo(BigInteger) Compares two BigInteger values.
Public methodStatic member DivMod Divides two big integers and saves the quotient and remainder.
Public methodStatic member DivModOne Divides two big integers.
Public method Equals(Double) Returns a value that indicates whether a big integer is equal to a double.
Public method Equals(Int32) Returns a value that indicates whether a big integer is equal to an integer.
Public method Equals(Int64) Returns a value that indicates whether a big integer is equal to a long integer.
Public method Equals(Object) Returns a value that indicates whether a big integer is equal to an object. (Overrides ValueType.Equals(Object).)
Public method Equals(UInt32) Returns a value that indicates whether a big integer is equal to an integer.
Public method Equals(UInt64) Returns a value that indicates whether a big integer is equal to a long integer.
Public method Equals(BigInteger) Determines if two big integers are equal.
Public methodStatic member Factorial Computes the factorial of a big integer.
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic member Gcd Computes the greatest common divisor.
Public method GetHashCode Computes the hash of a value. (Overrides ValueType.GetHashCode().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic member Negate Negates the sign of a big integer.
Public methodStatic member Power(BigInteger, BigInteger) Raises a big integer to the power of a big integer.
Public methodStatic member Power(BigInteger, BigInteger, BigInteger%) Raises a big integer to the power of a big integer, and stores the result.
Public methodStatic member Power(BigInteger, BigInteger, Rational%) Raises a big integer to the power of a big integer, and stores the result.
Public method TestBit Returns a value that indicates whether a test bit is set.
Public method ToHexString Converts the numeric value of the current big integer to its equivalent string representation of hex characters.
Public method ToString Converts the numeric value of the current big integer to its equivalent string representation. (Overrides ValueType.ToString().)
Public methodStatic member TryFactorial Computes the factorial of a big integer. A return value indicates whether the computation succeeded.

Top

Operators

  Name Description
Public operatorStatic member Addition Adds two big integers.
Public operatorStatic member BitwiseAnd Performs a bitwise AND operation on two big integers.
Public operatorStatic member BitwiseOr Performs the bitwise OR operation on two big integers.
Public operatorStatic member Decrement Subtracts one from a big integer.
Public operatorStatic member Division Divides two big integers.
Public operatorStatic member Equality(Double, BigInteger) Returns a value that indicates whether a double is equal to a big integer.
Public operatorStatic member Equality(Int32, BigInteger) Returns a value that indicates whether an integer is equal to a big integer.
Public operatorStatic member Equality(Int64, BigInteger) Returns a value that indicates whether a long is equal to a big integer.
Public operatorStatic member Equality(UInt32, BigInteger) Returns a value that indicates whether an unsigned integer is equal to a big integer.
Public operatorStatic member Equality(UInt64, BigInteger) Returns a value that indicates whether an unsigned long is equal to a big integer.
Public operatorStatic member Equality(BigInteger, BigInteger) Returns a value that indicates whether two big integers are equal.
Public operatorStatic member Equality(BigInteger, Double) Returns a value that indicates whether a big integer is equal to a double.
Public operatorStatic member Equality(BigInteger, Int32) Returns a value that indicates whether a big integer is equal to an integer.
Public operatorStatic member Equality(BigInteger, Int64) Returns a value that indicates whether a big integer is equal to a long.
Public operatorStatic member Equality(BigInteger, UInt32) Returns a value that indicates whether a big integer is equal to an unsigned integer.
Public operatorStatic member Equality(BigInteger, UInt64) Returns a value that indicates whether a big integer is equal to an unsigned long.
Public operatorStatic member ExclusiveOr Computes the bitwise exclusive OR on two big integers.
Public operatorStatic member Explicit(Double to BigInteger) Converts a double to a big integer.
Public operatorStatic member Explicit(BigInteger to Int64) Converts a big integer to a long.
Public operatorStatic member Explicit(BigInteger to Int32) Converts a big integer to an integer.
Public operatorStatic member Explicit(BigInteger to UInt32) Converts a big integer to an integer.
Public operatorStatic member Explicit(BigInteger to Double) Converts a big integer to a double.
Public operatorStatic member Explicit(BigInteger to UInt64) Converts a big integer to an unsigned long.
Public operatorStatic member GreaterThan(Double, BigInteger) Returns a value that indicates whether a big integer is greater than a double.
Public operatorStatic member GreaterThan(Int32, BigInteger) Returns a value that indicates whether a big integer is greater than an integer.
Public operatorStatic member GreaterThan(Int64, BigInteger) Returns a value that indicates whether a big integer is greater than a long.
Public operatorStatic member GreaterThan(UInt32, BigInteger) Returns a value that indicates whether a big integer is greater than an unsigned integer.
Public operatorStatic member GreaterThan(UInt64, BigInteger) Returns a value that indicates whether a big integer is greater than an unsigned long.
Public operatorStatic member GreaterThan(BigInteger, BigInteger) Returns a value that indicates whether a big integer is greater than another big integer.
Public operatorStatic member GreaterThan(BigInteger, Double) Returns a value that indicates whether a big integer is greater than a double.
Public operatorStatic member GreaterThan(BigInteger, Int32) Returns a value that indicates whether a big integer is greater than an integer.
Public operatorStatic member GreaterThan(BigInteger, Int64) Returns a value that indicates whether a big integer is larger than a long.
Public operatorStatic member GreaterThan(BigInteger, UInt32) Returns a value that indicates whether a big integer is greater than an unsigned integer.
Public operatorStatic member GreaterThan(BigInteger, UInt64) Returns a value that indicates whether a big integer is greater than an unsigned long.
Public operatorStatic member GreaterThanOrEqual(Double, BigInteger) Returns a value that indicates whether a big integer is greater than or equal to a double.
Public operatorStatic member GreaterThanOrEqual(Int32, BigInteger) Returns a value that indicates whether a big integer is greater than or equal to an integer.
Public operatorStatic member GreaterThanOrEqual(Int64, BigInteger) Returns a value that indicates whether a big integer is greater than or equal to a long.
Public operatorStatic member GreaterThanOrEqual(UInt32, BigInteger) Returns a value that indicates whether a big integer is greater than or equal to an unsigned integer.
Public operatorStatic member GreaterThanOrEqual(UInt64, BigInteger) Returns a value that indicates whether a big integer is greater than or equal to an unsigned long.
Public operatorStatic member GreaterThanOrEqual(BigInteger, BigInteger) Returns a value that indicates whether a big integer is greater than or equal to a big integer.
Public operatorStatic member GreaterThanOrEqual(BigInteger, Double) Returns a value that indicates whether a big integer is greater than or equal to a double.
Public operatorStatic member GreaterThanOrEqual(BigInteger, Int32) Returns a value that indicates whether a big integer is greater than or equal to an integer.
Public operatorStatic member GreaterThanOrEqual(BigInteger, Int64) Returns a value that indicates whether a big integer is greater than or equal to a long.
Public operatorStatic member GreaterThanOrEqual(BigInteger, UInt32) Returns a value that indicates whether a big integer is greater than or equal to an unsigned integer.
Public operatorStatic member GreaterThanOrEqual(BigInteger, UInt64) Returns a value that indicates whether a big integer is greater than or equal to an unsigned long.
Public operatorStatic member Implicit(Int32 to BigInteger) Converts an integer to a big integer.
Public operatorStatic member Implicit(Int64 to BigInteger) Converts a long to a big integer.
Public operatorStatic member Implicit(UInt32 to BigInteger) Converts an unsigned integer to a big integer.
Public operatorStatic member Implicit(UInt64 to BigInteger) Converts an unsigned long to a big integer.
Public operatorStatic member Increment Increments a big integer by one.
Public operatorStatic member Inequality(Double, BigInteger) Returns a value that indicates whether a double is not equal to a big integer.
Public operatorStatic member Inequality(Int32, BigInteger) Returns a value that indicates whether an integer is not equal to a big integer.
Public operatorStatic member Inequality(Int64, BigInteger) Returns a value that indicates whether a long is not equal to a big integer.
Public operatorStatic member Inequality(UInt32, BigInteger) Returns a value that indicates whether an unsigned integer is not equal to a big integer.
Public operatorStatic member Inequality(UInt64, BigInteger) Returns a value that indicates whether an unsigned long is not equal to a big integer.
Public operatorStatic member Inequality(BigInteger, BigInteger) Returns a value that indicates whether two big integers are not equal.
Public operatorStatic member Inequality(BigInteger, Double) Returns a value that indicates whether a big integer is not equal to a double.
Public operatorStatic member Inequality(BigInteger, Int32) Returns a value that indicates whether a big integer is not equal to an integer.
Public operatorStatic member Inequality(BigInteger, Int64) Returns a value that indicates whether a big integer is not equal to a long.
Public operatorStatic member Inequality(BigInteger, UInt32) Returns a value that indicates whether a big integer is not equal to an unsigned integer.
Public operatorStatic member Inequality(BigInteger, UInt64) Returns a value that indicates whether a big integer is not equal to an unsigned long.
Public operatorStatic member LeftShift Shifts a big integer a specified number of bits to the left.
Public operatorStatic member LessThan(Double, BigInteger) Returns a value that indicates whether a big integer is less than a double.
Public operatorStatic member LessThan(Int32, BigInteger) Returns a value that indicates whether a big integer is less than an integer.
Public operatorStatic member LessThan(Int64, BigInteger) Returns a value that indicates whether a big integer is less than a long.
Public operatorStatic member LessThan(UInt32, BigInteger) Returns a value that indicates whether a big integer is less than an unsigned integer.
Public operatorStatic member LessThan(UInt64, BigInteger) Returns a value that indicates whether a big integer is less than an unsigned long.
Public operatorStatic member LessThan(BigInteger, BigInteger) Returns a value that indicates whether a big integer is less than a second big integer.
Public operatorStatic member LessThan(BigInteger, Double) Returns a value that indicates whether a big integer is less than a double.
Public operatorStatic member LessThan(BigInteger, Int32) Returns a value that indicates whether a big integer is less than an integer.
Public operatorStatic member LessThan(BigInteger, Int64) Returns a value that indicates whether a big integer is less than an integer.
Public operatorStatic member LessThan(BigInteger, UInt32) Returns a value that indicates whether a big integer is less than an unsigned integer.
Public operatorStatic member LessThan(BigInteger, UInt64) Returns a value that indicates whether a big integer is less than an unsigned long.
Public operatorStatic member LessThanOrEqual(Double, BigInteger) Returns a value that indicates whether a big integer is less than or equal to a double.
Public operatorStatic member LessThanOrEqual(Int32, BigInteger) Returns a value that indicates whether a big integer is less than or equal to an integer.
Public operatorStatic member LessThanOrEqual(Int64, BigInteger) Returns a value that indicates whether a big integer is less than or equal to a long.
Public operatorStatic member LessThanOrEqual(UInt32, BigInteger) Returns a value that indicates whether a big integer is less than or equal to an unsigned integer.
Public operatorStatic member LessThanOrEqual(UInt64, BigInteger) Returns a value that indicates whether a big integer is less than or equal to an unsigned long.
Public operatorStatic member LessThanOrEqual(BigInteger, BigInteger) Returns a value that indicates whether a big integer is less than or equal to another big integer.
Public operatorStatic member LessThanOrEqual(BigInteger, Double) Returns a value that indicates whether a big integer is less than or equal to a double.
Public operatorStatic member LessThanOrEqual(BigInteger, Int32) Returns a value that indicates whether a big integer is less than or equal to an integer.
Public operatorStatic member LessThanOrEqual(BigInteger, Int64) Returns a value that indicates whether a big integer is less than or equal to a long.
Public operatorStatic member LessThanOrEqual(BigInteger, UInt32) Returns a value that indicates whether a big integer is less than or equal to an unsigned integer.
Public operatorStatic member LessThanOrEqual(BigInteger, UInt64) Returns a value that indicates whether a big integer is less than or equal to an unsigned long.
Public operatorStatic member Modulus Returns the remainder that results from division with two specified BigInteger values.
Public operatorStatic member Multiply Returns the product of two big integers.
Public operatorStatic member OnesComplement Returns the bitwise one's complement of a big integer.
Public operatorStatic member RightShift Shifts a big integer a specified number of bits to the right.
Public operatorStatic member Subtraction Subtracts a big integer from another big integer.
Public operatorStatic member UnaryNegation Negates a specified big integer.
Public operatorStatic member UnaryPlus Returns the value of a big integer.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.SolverFoundation.Common Namespace