java.lang.Object | |||||||||||||||||||||||||||||||||||||||||||||||||||
| | |||||||||||||||||||||||||||||||||||||||||||||||||||
| | - | - | java.lang.Number | ||||||||||||||||||||||||||||||||||||||||||||||||
| | |||||||||||||||||||||||||||||||||||||||||||||||||||
| | - | - | java.math.BigInteger | ||||||||||||||||||||||||||||||||||||||||||||||||
Immutable arbitrary-precision integers.
Type | Field | Summary |
---|---|---|
static BigInteger | ONE | The BigInteger constant one. |
static BigInteger | TEN | The BigInteger constant ten. |
static BigInteger | ZERO | The BigInteger constant zero. |
Constructor | Summary |
---|---|
BigInteger(byte[] val) | Translates a byte array containing the two's-complement binary representation of a BigInteger into a BigInteger. |
BigInteger(int signum, byte[] magnitude) | Translates the sign-magnitude representation of a BigInteger into a BigInteger. |
BigInteger(int bitLength, int certainty, Random rnd) | Creates a randomly generated positive BigInteger that is probably prime, with the specified bitLength. |
BigInteger(int numBits, Random rnd) | Creates a randomly generated BigInteger, uniformly distributed over the range 0 to (2numBits - 1), inclusive. |
BigInteger(String val) | Translates the decimal String representation of a BigInteger into a BigInteger. |
BigInteger(String val, int radix) | Translates the String representation of a BigInteger in the specified radix into a BigInteger. |
Return | Method | Summary |
---|---|---|
BigInteger | abs() | Returns a BigInteger whose value is the absolute value of this BigInteger. |
BigInteger | add(BigInteger val) | Returns a BigInteger whose value is (this + val). |
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). |
BigInteger | gcd(BigInteger val) | Returns a BigInteger whose value is the greatest common divisor of abs(this) and abs(val). |
BigInteger | mod(BigInteger m) | 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 | pow(int exponent) | Returns a BigInteger whose value is (thisexponent). |
BigInteger | subtract(BigInteger val) | Returns a BigInteger whose value is (this - val). |
BigInteger | remainder(BigInteger val) | Returns a BigInteger whose value is (this % val). |
Return | Method | Summary |
---|---|---|
boolean | isProbablePrime(int certainty) | Returns true if this BigInteger is probably prime, false if it's definitely composite. |
BigInteger | nextProbablePrime() | Returns the first integer greater than this BigInteger that is probably prime. |
static BigInteger | probablePrime(int bitLength, Random rnd) | Returns a positive BigInteger that is probably prime, with the specified bitLength. |
Return | Method | Summary |
---|---|---|
BigInteger | and(BigInteger val) | Returns a BigInteger whose value is (this & val). |
BigInteger | andNot(BigInteger val) | Returns a BigInteger whose value is (this & ~val). |
BigInteger | not() | Returns a BigInteger whose value is (~this). |
BigInteger | or(BigInteger val) | Returns a BigInteger whose value is (this | val). |
Return | Method | Summary |
---|---|---|
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. |
BigInteger | flipBit(int n) | Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit flipped. |
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). |
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). |
boolean | testBit(int n) | Returns true if and only if the designated bit is set. |
BigInteger | xor(BigInteger val) | Returns a BigInteger whose value is (this ^ val). |
Return | Method | Summary |
---|---|---|
double | doubleValue() | Converts this BigInteger to a double. |
float | floatValue() | Converts this BigInteger to a float. |
int | intValue() | Converts this BigInteger to an int. |
long | longValue() | Converts this BigInteger to a long. |
Return | Method | Summary |
---|---|---|
int | compareTo(BigInteger val) | Compares this BigInteger with the specified BigInteger. |
boolean | equals(Object x) | Compares this BigInteger with the specified Object for equality. |
BigInteger | max(BigInteger val) | Returns the maximum of this BigInteger and val. |
BigInteger | min(BigInteger val) | Returns the minimum of this BigInteger and val. |
Return | Method | Summary |
---|---|---|
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. |
Return | Method | Summary |
---|---|---|
static BigInteger | valueOf(long val) | Returns a BigInteger whose value is equal to that of the specified long. |
Return | Method | Summary |
---|---|---|
int | signum() | Returns the signum function of this BigInteger. |
Return | Method | Summary |
---|---|---|
byte[] | toByteArray() | Returns a byte array containing the two's-complement representation of this BigInteger. |
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |