Static variables
Static methods
staticbitCount(this:BigInt_):Int
Counts the number of bits that are set to 1.
Returns:
The number of set bits.
staticbitLength(this:BigInt_):Int
Returns the number of bits of this BigInt
.
Returns:
The number of bits required to represent this number.
staticinlinefromHexSigned(value:String):BigInt
staticinlinefromHexUnsigned(value:String):BigInt
staticinlinefromInt(value:Int):BigInt
Creates a new BigInt from an Int.
Parameters:
value | The Int value. |
---|
staticinlinefromString(value:String, radix:Int = 10):BigInt
staticinlinefromUnsignedInts(value:Vector<Int>, length:Int = 0):BigInt
staticinlinegetBit(this:BigInt_, index:Int):Int
Gets the value of a single bit at the specified index.
Parameters:
index | The zero-based index of the bit to get. |
---|
Returns:
1 if the bit is set, otherwise 0.
staticgetLowestSetBit(this:BigInt_):Int
Gets the index of the lowest-set (rightmost) bit.
Returns:
The index of the rightmost '1' bit, or -1 if the number is zero.
staticgetPowerOfTwo(exponent:Int):BigInt
Calculates 2 raised to the power of the given exponent.
Parameters:
exponent | The exponent. |
---|
Returns:
A BigInt
equal to 2^exponent
.
staticinlineisNegative(this:BigInt_):Bool
staticinlineisPositive(this:BigInt_):Bool
staticisProbablePrime(this:BigInt_, tolerance:UInt):Bool
staticmodInverse(this:BigInt_, modulus:BigInt_):BigInt
staticmodPow(this:BigInt_, exponent:BigInt, modulus:BigInt):BigInt
Calculates (this ^ exponent) mod modulus
.
Parameters:
exponent | The exponent. |
---|---|
modulus | The modulus. |
Returns:
The result of the modular exponentiation.
staticnextProbablePrime(this:BigInt_):BigInt
staticrandomInRange(min:BigInt, max:BigInt):BigInt
staticrandomPrime(bits:Int32, tolerance:UInt):BigInt
Generates a probable prime number with a specified bit-length.
Parameters:
bits | The desired bit-length of the prime. |
---|---|
tolerance | The certainty level for the primality test. |
Returns:
A probable prime BigInt
.
staticinlinetoHex(this:BigInt_):String
Returns the hexadecimal string representation of this BigInt
.
This is a shorthand for toString(16)
.
Returns:
The hexadecimal string.