The BigInteger type exposes the following members.
Constructors
Name | Description | |
---|---|---|
BigInteger()()()() |
Constructor (Default value for BigInteger is 0).
|
|
BigInteger(array<Byte>[]()[][]) |
Constructor.
The lowest index of the input byte array (i.e [0]) should contain the most significant byte of the number, and the highest index should contain the least significant byte. |
|
BigInteger(Int64) |
Constructor (Default value provided by long).
|
|
BigInteger(array<UInt32>[]()[][]) |
Constructor (Default value provided by an array of unsigned integers)
|
|
BigInteger(UInt64) |
Constructor (Default value provided by ulong).
|
|
BigInteger(BigInteger) |
Constructor (Default value provided by BigInteger).
|
|
BigInteger(array<Byte>[]()[][], Int32) |
Constructor (Default value provided by an array of bytes of the specified length.)
|
|
BigInteger(String, Int32) |
Constructor (Default value provided by a string of digits of the specified base)
|
Methods
Name | Description | |
---|---|---|
abs |
Returns the absolute value
|
|
bitCount |
Returns the position of the most significant bit in the BigInteger.
|
|
Equals |
Equals operator
(Overrides Object..::..Equals(Object).) |
|
FermatLittleTest |
Probabilistic prime test based on Fermat's little theorem
|
|
gcd |
Gcd functionality
|
|
genCoPrime |
Generates a random number with the specified number of bits such that gcd(number, this) = 1
|
|
genPseudoPrime |
Generates a positive BigInteger that is probably prime.
|
|
genRandomBits |
Populates "this" with the specified amount of random bits
|
|
getBytes |
Returns the value of the BigInteger as a byte array. The lowest
index contains the MSB.
|
|
GetHashCode |
GetsHashCode implementation
(Overrides Object..::..GetHashCode()()()().) |
|
IntValue |
Returns the lowest 4 bytes of the BigInteger as an int.
|
|
isProbablePrime()()()() |
Determines whether this BigInteger is probably prime using a
combination of base 2 strong pseudoprime test and Lucas strong
pseudoprime test.
|
|
isProbablePrime(Int32) | ||
Jacobi |
Computes the Jacobi Symbol for a and b.
|
|
LongValue |
Returns the lowest 8 bytes of the BigInteger as an long.
|
|
LucasSequence |
Returns the k_th number in the Lucas Sequence reduced modulo n.
|
|
LucasStrongTest |
Implementation of the Lucas Strong Pseudo Prime test.
|
|
Main |
Entry point
|
|
max |
Max implementation
|
|
min |
Min implementation
|
|
modInverse |
Returns the modulo inverse of this. Throws ArithmeticException if
the inverse does not exist. (i.e. gcd(this, modulus) != 1)
|
|
modPow |
Modulo Exponentiation
|
|
MulDivTest |
Tests the correct implementation of the /, %, * and + operators
|
|
Pow | ||
RabinMillerTest |
Probabilistic prime test based on Rabin-Miller's
|
|
root | ||
RSATest |
Tests the correct implementation of the modulo exponential function using RSA encryption and decryption (using pre-computed encryption and decryption keys).
|
|
RSATest2 |
Tests the correct implementation of the modulo exponential and
inverse modulo functions using RSA encryption and decryption. The two
pseudoprimes p and q are fixed, but the two RSA keys are generated
for each round of testing.
|
|
setBit |
Sets the value of the specified bit to 1. The Least Significant Bit position is 0.
|
|
SolovayStrassenTest |
Probabilistic prime test based on Solovay-Strassen (Euler Criterion)
|
|
sqrt |
Returns a value that is equivalent to the integer square root
of the BigInteger.
|
|
SqrtTest |
Tests the correct implementation of sqrt() method.
|
|
ToHexString |
Returns a hex string showing the contains of the BigInteger
|
|
ToString()()()() |
Returns a string representing the BigInteger in base 10.
(Overrides Object..::..ToString()()()().) |
|
ToString(Int32) |
Returns a string representing the BigInteger in sign-and-magnitude format in the specified radix.
|
|
unsetBit |
Sets the value of the specified bit to 0. The Least Significant Bit position is 0.
|
Operators
Name | Description | |
---|---|---|
Addition |
Overloading of addition operator
|
|
BitwiseAnd |
Overloading of bitwise AND operator
|
|
BitwiseOr |
Overloading of bitwise OR operator
|
|
Decrement |
Overloading of the unary -- operator
|
|
Division |
Overloading of division operator
|
|
Equality |
Overloading of equality operator
|
|
ExclusiveOr |
Overloading of bitwise XOR operator
|
|
GreaterThan |
Overloading of inequality operator
|
|
GreaterThanOrEqual |
Overloading of inequality operator
|
|
Implicit Widening Implicit Implicit Implicit (Int32 to BigInteger) |
int ctor
|
|
Implicit Widening Implicit Implicit Implicit (Int64 to BigInteger) |
Overloading of the typecast operator.
For BigInteger bi = 10;
|
|
Implicit Widening Implicit Implicit Implicit (UInt32 to BigInteger) |
uint ctor
|
|
Implicit Widening Implicit Implicit Implicit (UInt64 to BigInteger) |
ulong ctor
|
|
Increment |
Overloading of the unary ++ operator
|
|
Inequality |
Overloading of inequality operator
|
|
LeftShift | ||
LessThan |
Overloading of inequality operator
|
|
LessThanOrEqual |
Overloading of inequality operator
|
|
Modulus |
Overloading of modulus operator
|
|
Multiply |
Overloading of multiplication operator
|
|
OnesComplement |
Overloading of the NOT operator (1's complement)
|
|
RightShift |
Overloading of unary >> operators
|
|
Subtraction |
Overloading of subtraction operator
|
|
UnaryNegation |
Overloading of the NEGATE operator (2's complement)
|
Extension Methods
Name | Description | |
---|---|---|
ConvertTo(Type) | Overloaded.
Converts a source to the given type.
(Defined by ObjectExtension.) |
|
ConvertTo(Type, TypeConverter) | Overloaded.
Converts a source to the given type.
(Defined by ObjectExtension.) |
|
ConvertTo(Type, Boolean) | Overloaded.
Converts a source to the given type.
(Defined by ObjectExtension.) |
|
ConvertTo(Type, TypeConverter, Boolean) | Overloaded.
Converts a source to the given type.
(Defined by ObjectExtension.) |
|
ConvertTo<(Of <<'(T>)>>)()()()() | Overloaded.
Converts a source to the given type.
(Defined by ObjectExtension.) |
|
ConvertTo<(Of <<'(T>)>>)(TypeConverter) | Overloaded.
Converts a source to the given type.
(Defined by ObjectExtension.) |
|
GetCurrentStackTrace |
Gets current stack trace information.
(Defined by ObjectExtension.) |
|
GetDebugInformation |
Gets the debug information for currently executing code.
(Defined by ObjectExtension.) |
|
GetExecutingMethodName |
Gets the executing method name.
(Defined by ObjectExtension.) |
|
GetPropertyType |
Gets a property type.
(Defined by ObjectExtension.) |
|
GetPropertyValue |
Gets a property or field value from the object (Dot notation enabled).
(Defined by ObjectExtension.) |
|
PropertyExists |
Check if property exists.
(Defined by ObjectExtension.) |
|
SetPropertyValue |
Sets a property or field value to the object (Dot notation enabled).
(Defined by ObjectExtension.) |
Fields
Name | Description | |
---|---|---|
dataLength |
Number of actual chars used.
|
|
primesBelow2000 |
Provides a array of the primes smaller than 2000 to test the generated prime number.
|