public class BigInteger extends Number implements Comparable, Serializable
Modifier and Type | Field and Description |
---|---|
static BigInteger |
ONE |
static BigInteger |
ZERO |
serialVersionUID
Constructor and Description |
---|
BigInteger(byte[] val) |
BigInteger(int signum,
byte[] magnitude) |
BigInteger(int bitLength,
int certainty,
Random rnd) |
BigInteger(int numBits,
Random rnd) |
BigInteger(String val) |
BigInteger(String val,
int radix) |
Modifier and Type | Method and Description |
---|---|
BigInteger |
abs() |
BigInteger |
add(BigInteger val)
Returns a BigInteger whose value is (this + val).
|
BigInteger |
and(BigInteger val)
Returns a BigInteger whose value is (this & val).
|
BigInteger |
andNot(BigInteger val)
Returns a BigInteger whose value is (this & ~val).
|
int |
bitCount()
Returns the number of bits in the two's complement representation of this BigInteger that differ from its sign bit.
|
int |
bitLength()
Returns the number of bits in the minimal two's-complement representation of this BigInteger, excluding a sign bit.
|
BigInteger |
clearBit(int n)
Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit cleared.
|
int |
compareTo(BigInteger val)
Compares this BigInteger with the specified BigInteger.
|
int |
compareTo(Object other)
Compare this object with another.
|
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()
Return the value of this
Number as a float . |
boolean |
equals(Object x)
Compares this BigInteger with the specified Object for equality.
|
BigInteger |
flipBit(int n)
Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit flipped.
|
float |
floatValue()
Return the value of this
Number as a float . |
BigInteger |
gcd(BigInteger val)
Returns a BigInteger whose value is the greatest common divisor of abs(this) and abs(val).
|
int |
getLowestSetBit()
Returns the index of the rightmost (lowest-order) one bit in this BigInteger (the number of zero bits to the right of the rightmost one bit).
|
int |
hashCode()
Returns the hash code for this BigInteger.
|
int |
intValue()
Return the value of this
Number as an int . |
boolean |
isProbablePrime(int certainty)
Returns true if this BigInteger is probably prime, false if it's definitely composite.
|
long |
longValue()
Return the value of this
Number as a long . |
BigInteger |
max(BigInteger val)
Returns the maximum of this BigInteger and val.
|
BigInteger |
min(BigInteger val)
Returns the minimum of this BigInteger and val.
|
BigInteger |
mod(BigInteger val)
Returns a BigInteger whose value is (this mod m).
|
BigInteger |
modInverse(BigInteger m)
Returns a BigInteger whose value is (this-1 mod m).
|
BigInteger |
modPow(BigInteger exponent,
BigInteger m)
Returns a BigInteger whose value is (thisexponent mod m).
|
BigInteger |
multiply(BigInteger val)
Returns a BigInteger whose value is (this * val).
|
BigInteger |
negate()
Returns a BigInteger whose value is (-this).
|
BigInteger |
not()
Returns a BigInteger whose value is (~this).
|
BigInteger |
or(BigInteger val)
Returns a BigInteger whose value is (this | val).
|
BigInteger |
pow(int exponent)
Returns a BigInteger whose value is (thisexponent).
|
BigInteger |
remainder(BigInteger val)
Returns a BigInteger whose value is (this % val).
|
BigInteger |
setBit(int n)
Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit set.
|
BigInteger |
shiftLeft(int n)
Returns a BigInteger whose value is (this << n).
|
BigInteger |
shiftRight(int n)
Returns a BigInteger whose value is (this >> n).
|
int |
signum()
Returns the signum function of this BigInteger.
|
BigInteger |
subtract(BigInteger val)
Returns a BigInteger whose value is (this - val).
|
boolean |
testBit(int n)
Returns true if and only if the designated bit is set.
|
byte[] |
toByteArray()
Returns a byte array containing the two's-complement representation of this BigInteger.
|
String |
toString()
Returns the decimal String representation of this BigInteger.
|
String |
toString(int radix)
Returns the String representation of this BigInteger in the given radix.
|
static BigInteger |
valueOf(long val) |
BigInteger |
xor(BigInteger val) |
byteValue, shortValue
public static BigInteger ONE
public static BigInteger ZERO
public BigInteger(byte[] val)
public BigInteger(int signum, byte[] magnitude)
public BigInteger(int bitLength, int certainty, Random rnd)
public BigInteger(int numBits, Random rnd)
public BigInteger(String val)
public BigInteger(String val, int radix)
public int intValue()
Number
Number
as an int
.public long longValue()
Number
Number
as a long
.public float floatValue()
Number
Number
as a float
.floatValue
in class Number
public double doubleValue()
Number
Number
as a float
.doubleValue
in class Number
public int compareTo(Object other)
Comparable
compareTo
in interface Comparable
public BigInteger abs()
public BigInteger add(BigInteger val)
public BigInteger and(BigInteger val)
public BigInteger andNot(BigInteger val)
public int bitCount()
public int bitLength()
public BigInteger clearBit(int n)
public int compareTo(BigInteger val)
public BigInteger divide(BigInteger val)
public BigInteger[] divideAndRemainder(BigInteger val)
public boolean equals(Object x)
public BigInteger flipBit(int n)
public BigInteger gcd(BigInteger val)
public int getLowestSetBit()
public int hashCode()
public boolean isProbablePrime(int certainty)
public BigInteger max(BigInteger val)
public BigInteger min(BigInteger val)
public BigInteger mod(BigInteger val)
public BigInteger modInverse(BigInteger m)
public BigInteger modPow(BigInteger exponent, BigInteger m)
public BigInteger multiply(BigInteger val)
public BigInteger negate()
public BigInteger not()
public BigInteger or(BigInteger val)
public BigInteger pow(int exponent)
public BigInteger remainder(BigInteger val)
public BigInteger setBit(int n)
public BigInteger shiftLeft(int n)
public BigInteger shiftRight(int n)
public int signum()
public BigInteger subtract(BigInteger val)
public boolean testBit(int n)
public byte[] toByteArray()
public String toString()
public String toString(int radix)
public static BigInteger valueOf(long val)
public BigInteger xor(BigInteger val)