BigInteger Members

BigInteger Members

Class Overview | This Package | All Packages

Constructors
Name Description
BigInteger(byte[]) Translates a byte array containing the two's-complement representation of a (signed) integer into a BigInteger.
BigInteger(int, byte[]) Translates the sign-magnitude representation of an integer into a BigInteger.
BigInteger(int, int, Random) Returns a randomly selected BigInteger with the specified bitLength that is probably prime.
BigInteger(int, Random) Returns a random number uniformly distributed on [0, 2**numBits - 1] (assuming a fair source of random bits is provided in rndSrc).
BigInteger(String) Translates a string containing an optional minus sign followed by a sequence of one or more decimal digits into a BigInteger.
BigInteger(String, int) Translates a string containing an optional minus sign followed by a sequence of one or more digits in the specified radix into a BigInteger.

Methods
Name Description
abs() Returns a BigInteger whose value is the absolute value of this number.
add(BigInteger) Returns a BigInteger whose value is (this + val).
and(BigInteger) Returns a BigInteger whose value is (this & val).
andNot(BigInteger) Returns a BigInteger whose value is (this & ~val).
bitCount() Returns the number of bits in the two's complement representation of this number that differ from its sign bit.
bitLength() Returns the number of bits in the minimal two's-complement representation of this number, *excluding* a sign bit, i.e., (ceil(log2(this < 0 ? -this : this + 1))).
clearBit(int) Returns a BigInteger whose value is equivalent to this number with the designated bit cleared.
compareTo(BigInteger) Returns -1, 0 or 1 as this number is less than, equal to, or greater than val.
divide(BigInteger) Returns a BigInteger whose value is (this / val).
divideAndRemainder(BigInteger) Returns an array of two BigIntegers.
doubleValue() Converts the number to a double.
equals(Object) Returns true iff x is a BigInteger whose value is equal to this number.
flipBit(int) Returns a BigInteger whose value is equivalent to this number with the designated bit flipped.
floatValue() Converts this number to a float.
gcd(BigInteger) Returns a BigInteger whose value is the greatest common denominator of abs(this) and abs(val).
getLowestSetBit() Returns the index of the rightmost (lowest-order) one bit in this number (i.e., the number of zero bits to the right of the rightmost one bit).
hashCode() Computes a hash code for this object.
intValue() Converts this number to an int.
isProbablePrime(int) Returns true if this BigInteger is probably prime, false if it's definitely composite.
longValue() Converts this number to a long.
max(BigInteger) Returns the BigInteger whose value is the greater of this and val.
min(BigInteger) Returns the BigInteger whose value is the lesser of this and val.
mod(BigInteger) Returns a BigInteger whose value is this mod m.
modInverse(BigInteger) Returns modular multiplicative inverse of this, mod m.
modPow(BigInteger, BigInteger) Returns a BigInteger whose value is (this ** exponent) mod m.
multiply(BigInteger) Returns a BigInteger whose value is (this * val).
negate() Returns a BigInteger whose value is (-1 * this).
not() Returns a BigInteger whose value is (~this).
or(BigInteger) Returns a BigInteger whose value is (this | val).
pow(int) Returns a BigInteger whose value is (this ** exponent).
remainder(BigInteger) Returns a BigInteger whose value is (this % val).
setBit(int) Returns a BigInteger whose value is equivalent to this number with the designated bit set.
shiftLeft(int) Returns a BigInteger whose value is (this << n).
shiftRight(int) Returns a BigInteger whose value is (this >> n).
signum() Returns the signum function of this number (i.e., -1, 0 or 1 as the value of this number is negative, zero or positive).
subtract(BigInteger) Returns a BigInteger whose value is (this - val).
testBit(int) Returns true iff the designated bit is set.
toByteArray() Returns the two's-complement representation of this number.
toString() Returns the string representation of this number, radix 10.
toString(int) Returns the string representation of this number in the given radix.
valueOf(long) Returns a BigInteger with the specified value.
xor(BigInteger) Returns a BigInteger whose value is (this ^ val).