java.math.BigInteger (JDK 1.1)
This subclass of java.lang.Number represents integers that can be arbitrarily large--i.e., integers that are not limited to the 64 bits available with the long data type. BigInteger defines methods that duplicate the functionality of the standard Java arithmetic and bit-manipulation operators. The compareTo() method compares two BigInteger objects, and returns -1, 0, or 1 to indicate the result of the comparison.
The gcd(), modPow(), modInverse(), and isProbablePrime() methods perform advanced operations and are used primarily in cryptography and related algorithms.
public classBigIntegerextends Number { //Public ConstructorspublicBigInteger(byte[]val) throws NumberFormatException; publicBigInteger(intsignum, byte[]magnitude) throws NumberFormatException; publicBigInteger(Stringval, intradix) throws NumberFormatException; publicBigInteger(Stringval) throws NumberFormatException; publicBigInteger(intnumBits, RandomrndSrc) throws IllegalArgumentException; publicBigInteger(intbitLength, intcertainty, Randomrnd); //Class Methodspublic static BigIntegervalueOf(longval); //Public Instance Methodspublic BigIntegerabs(); public BigIntegeradd(BigIntegerval) throws ArithmeticException; public BigIntegerand(BigIntegerval); public BigIntegerandNot(BigIntegerval); public intbitCount(); public intbitLength(); public BigIntegerclearBit(intn) throws ArithmeticException; public intcompareTo(BigIntegerval); public BigIntegerdivide(BigIntegerval) throws ArithmeticException; public BigInteger[]divideAndRemainder(BigIntegerval) throws ArithmeticException; public doubledoubleValue(); //Defines Numberpublic booleanequals(Objectx); //Overrides Objectpublic BigIntegerflipBit(intn) throws ArithmeticException; public floatfloatValue(); //Defines Numberpublic BigIntegergcd(BigIntegerval); public intgetLowestSetBit(); public inthashCode(); //Overrides Objectpublic intintValue(); //Defines Numberpublic booleanisProbablePrime(intcertainty); public longlongValue(); //Defines Numberpublic BigIntegermax(BigIntegerval); public BigIntegermin(BigIntegerval); public BigIntegermod(BigIntegerm); public BigIntegermodInverse(BigIntegerm) throws ArithmeticException; public BigIntegermodPow(BigIntegerexponent, BigIntegerm); public BigIntegermultiply(BigIntegerval); public BigIntegernegate(); public BigIntegernot(); public BigIntegeror(BigIntegerval); public BigIntegerpow(intexponent) throws ArithmeticException; public BigIntegerremainder(BigIntegerval) throws ArithmeticException; public BigIntegersetBit(intn) throws ArithmeticException; public BigIntegershiftLeft(intn); public BigIntegershiftRight(intn); public intsignum(); public BigIntegersubtract(BigIntegerval); public booleantestBit(intn) throws ArithmeticException; public byte[]toByteArray(); public StringtoString(intradix); public StringtoString(); //Overrides Objectpublic BigIntegerxor(BigIntegerval); }
Hierarchy:
Object->Number(Serializable)->BigInteger
Passed To:
BigDecimal()
Returned By:
BigDecimal.toBigInteger()