Java Reference
In-Depth Information
Table 22-3
Methods in the BigInteger Class (continued)
RETURNS
METHOD/ACTION
int
bitLength()
Returns the number of bits in the minimal two's-
complement representation of this BigInteger,
excluding a sign bit
BigInteger
learBit(int n)
Returns a BigInteger whose value is equivalent
to this BigIntegerwith the designated bit
cleared
int
compareTo(BigInteger val)
Compares this BigInteger with the specified
BigInteger
int
compareTo(Object o)
Compares this BigInteger with the specified
object
BigInteger
divide(BigInteger val)
Returns a BigInteger whose value is (this / val)
BigInteger[]
divideAndRemainder(BigInteger val)
Returns an array of two BigIntegers containing
(this / val) followed by (this % val)
Double
doubleValue()
Converts this BigInteger to a double
boolean
equals(Object x)
Compares this BigInteger with the specified
Object forequality
BigInteger
flipBit(int n)
Returns a BigInteger whose value is equivalent
to this BigIntegerwith the designated bit flipped
Float
floatValue()
Converts this BigInteger to a float
BigInteger
gcd(BigInteger val)
Returns a BigInteger whose value is the greatest
common divisorof abs(this) and abs(val)
int
getLowestSetBit()
Returns the index of the rightmost (lowest-order)
one bit in this BigInteger(the numberof zero
bits to the right of the rightmost one bit)
int
hashCode()
Returns the hash code for this BigInteger
Int
intValue()
Converts this BigInteger to an int
boolean
isProbablePrime(int certainty)
Returns true if this BigInteger is probably prime,
false if it's definitely composite
long
longValue()
Converts this BigInteger to a long
(continues)
Search WWH ::




Custom Search