java.math
public class BigInteger extends Number implements Comparable<BigInteger>
UNKNOWN: December 20, 1999. believed complete and correct.
Field Summary | |
---|---|
static BigInteger | ONE
The constant one as a BigInteger. |
static BigInteger | TEN
The constant ten as a BigInteger. |
static BigInteger | ZERO
The constant zero as a BigInteger. |
Constructor Summary | |
---|---|
BigInteger(String val, int radix) | |
BigInteger(String val) | |
BigInteger(byte[] val) | |
BigInteger(int signum, byte[] magnitude) | |
BigInteger(int numBits, Random rnd) | |
BigInteger(int bitLength, int certainty, Random rnd) |
Method Summary | |
---|---|
BigInteger | abs() |
BigInteger | add(BigInteger val) |
BigInteger | and(BigInteger y) Return the logical (bit-wise) "and" of two BigIntegers. |
BigInteger | andNot(BigInteger val) |
int | bitCount() Count one bits in a BigInteger.
|
int | bitLength() Calculates ceiling(log2(this < 0 ? |
BigInteger | clearBit(int n) |
int | compareTo(BigInteger val) |
BigInteger | divide(BigInteger val) |
BigInteger[] | divideAndRemainder(BigInteger val) |
double | doubleValue() |
boolean | equals(Object obj) |
BigInteger | flipBit(int n) |
float | floatValue() |
BigInteger | gcd(BigInteger y) |
int | getLowestSetBit() |
int | hashCode() |
int | intValue() |
boolean | isProbablePrime(int certainty) Returns |
long | longValue() |
BigInteger | max(BigInteger val) |
BigInteger | min(BigInteger val) |
BigInteger | mod(BigInteger m) |
BigInteger | modInverse(BigInteger y) |
BigInteger | modPow(BigInteger exponent, BigInteger m) |
BigInteger | multiply(BigInteger y) |
BigInteger | negate() |
BigInteger | not() Return the logical (bit-wise) negation of a BigInteger. |
BigInteger | or(BigInteger y) Return the logical (bit-wise) "(inclusive) or" of two BigIntegers. |
BigInteger | pow(int exponent) Calculate the integral power of a BigInteger. |
static BigInteger | probablePrime(int bitLength, Random rnd)
Return a BigInteger that is bitLength bits long with a
probability < 2^-100 of being composite.
|
BigInteger | remainder(BigInteger val) |
BigInteger | setBit(int n) |
BigInteger | shiftLeft(int n) |
BigInteger | shiftRight(int n) |
int | signum() |
BigInteger | subtract(BigInteger val) |
boolean | testBit(int n) |
byte[] | toByteArray() |
String | toString() |
String | toString(int radix) |
static BigInteger | valueOf(long val) Return a (possibly-shared) BigInteger with a given long value. |
BigInteger | xor(BigInteger y) Return the logical (bit-wise) "exclusive or" of two BigIntegers. |
Since: 1.2
Since: 1.5
Since: 1.2
Since: 1.2
Returns true
if this BigInteger is probably prime,
false
if it's definitely composite. If certainty
is <= 0
, true
is returned.
Parameters: certainty a measure of the uncertainty that the caller is willing
to tolerate: if the call returns true
the probability that
this BigInteger is prime exceeds (1 - 1/2certainty)
.
The execution time of this method is proportional to the value of this
parameter.
Returns: true
if this BigInteger is probably prime,
false
if it's definitely composite.
Parameters: exponent the exponent (must be non-negative)
Parameters: bitLength length in bits of resulting number rnd random number generator to use
Throws: ArithmeticException if bitLength < 2
Since: 1.4