public class BigInteger extends Object
| Modifier and Type | Field and Description |
|---|---|
static BigInteger |
ONE |
static BigInteger |
ZERO |
| Constructor and Description |
|---|
BigInteger(byte[] bval) |
BigInteger(int sign,
byte[] mag) |
BigInteger(int bitLength,
int certainty,
Random rnd) |
BigInteger(int numBits,
Random rnd) |
BigInteger(String sval) |
BigInteger(String sval,
int rdx) |
public static final BigInteger ZERO
public static final BigInteger ONE
public BigInteger(String sval) throws NumberFormatException
NumberFormatExceptionpublic BigInteger(String sval, int rdx) throws NumberFormatException
NumberFormatExceptionpublic BigInteger(byte[] bval)
throws NumberFormatException
NumberFormatExceptionpublic BigInteger(int sign,
byte[] mag)
throws NumberFormatException
NumberFormatExceptionpublic BigInteger(int numBits,
Random rnd)
throws IllegalArgumentException
IllegalArgumentExceptionpublic BigInteger(int bitLength,
int certainty,
Random rnd)
throws ArithmeticException
ArithmeticExceptionpublic BigInteger abs()
public BigInteger add(BigInteger val) throws ArithmeticException
ArithmeticExceptionpublic BigInteger and(BigInteger value)
public BigInteger andNot(BigInteger value)
public int bitCount()
public int bitLength()
public int compareTo(Object o)
public int compareTo(BigInteger val)
public BigInteger divide(BigInteger val) throws ArithmeticException
ArithmeticExceptionpublic BigInteger[] divideAndRemainder(BigInteger val) throws ArithmeticException
ArithmeticExceptionpublic boolean equals(Object val)
Objectpublic BigInteger gcd(BigInteger val)
public int hashCode()
Objectpublic int intValue()
public byte byteValue()
public boolean isProbablePrime(int certainty)
From Knuth Vol 2, pg 395.
public long longValue()
public BigInteger max(BigInteger val)
public BigInteger min(BigInteger val)
public BigInteger mod(BigInteger m) throws ArithmeticException
ArithmeticExceptionpublic BigInteger modInverse(BigInteger m) throws ArithmeticException
ArithmeticExceptionpublic BigInteger modPow(BigInteger exponent, BigInteger m) throws ArithmeticException
ArithmeticExceptionpublic BigInteger multiply(BigInteger val)
public BigInteger negate()
public BigInteger not()
public BigInteger pow(int exp) throws ArithmeticException
ArithmeticExceptionpublic static BigInteger probablePrime(int bitLength, Random random)
public BigInteger remainder(BigInteger n) throws ArithmeticException
ArithmeticExceptionpublic BigInteger shiftLeft(int n)
public BigInteger shiftRight(int n)
public int signum()
public BigInteger subtract(BigInteger val)
public byte[] toByteArray()
public BigInteger xor(BigInteger val)
public BigInteger or(BigInteger value)
public BigInteger setBit(int n) throws ArithmeticException
ArithmeticExceptionpublic BigInteger clearBit(int n) throws ArithmeticException
ArithmeticExceptionpublic BigInteger flipBit(int n) throws ArithmeticException
ArithmeticExceptionpublic String toString()
Objectpublic String toString(int rdx)
public static BigInteger valueOf(long val)
public int getLowestSetBit()
public boolean testBit(int n)
throws ArithmeticException
ArithmeticException