BigInteger class

                                 
    java.lang.Object                            
     |                           
     |--java.lang.Number                        
         |                       
         |--java.math.BigInteger                    
                                 

Immutable arbitrary-precision integers.

TypeFieldSummary
static BigIntegerONEThe BigInteger constant one.
static BigIntegerTENThe BigInteger constant ten.
static BigIntegerZEROThe BigInteger constant zero.

ConstructorSummary
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.

ReturnMethodSummary
BigIntegerabs()Returns a BigInteger whose value is the absolute value of this BigInteger.
BigIntegeradd(BigInteger val)Returns a BigInteger whose value is (this + val).
BigIntegerdivide(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).
BigIntegergcd(BigInteger val)Returns a BigInteger whose value is the greatest common divisor of abs(this) and abs(val).
BigIntegermod(BigInteger m)Returns a BigInteger whose value is (this mod m).
BigIntegermodInverse(BigInteger m)Returns a BigInteger whose value is (this-1 mod m).
BigIntegermodPow(BigInteger exponent, BigInteger m)Returns a BigInteger whose value is (thisexponent mod m).
BigIntegermultiply(BigInteger val)Returns a BigInteger whose value is (this * val).
BigIntegernegate()Returns a BigInteger whose value is (-this).
BigIntegerpow(int exponent)Returns a BigInteger whose value is (thisexponent).
BigIntegersubtract(BigInteger val)Returns a BigInteger whose value is (this - val).
BigIntegerremainder(BigInteger val)Returns a BigInteger whose value is (this % val).

ReturnMethodSummary
booleanisProbablePrime(int certainty)Returns true if this BigInteger is probably prime, false if it's definitely composite.
BigIntegernextProbablePrime()Returns the first integer greater than this BigInteger that is probably prime.
static BigIntegerprobablePrime(int bitLength, Random rnd)Returns a positive BigInteger that is probably prime, with the specified bitLength.

ReturnMethodSummary
BigIntegerand(BigInteger val) Returns a BigInteger whose value is (this & val).
BigIntegerandNot(BigInteger val) Returns a BigInteger whose value is (this & ~val).
BigIntegernot()Returns a BigInteger whose value is (~this).
BigIntegeror(BigInteger val)Returns a BigInteger whose value is (this | val).

ReturnMethodSummary
intbitCount()Returns the number of bits in the two's complement representation of this BigInteger that differ from its sign bit.
intbitLength()Returns the number of bits in the minimal two's-complement representation of this BigInteger, excluding a sign bit.
BigIntegerclearBit(int n)Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit cleared.
BigIntegerflipBit(int n)Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit flipped.
intgetLowestSetBit()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).
BigIntegersetBit(int n)Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit set.
BigIntegershiftLeft(int n) Returns a BigInteger whose value is (this << n).
BigIntegershiftRight(int n) Returns a BigInteger whose value is (this >> n).
booleantestBit(int n)Returns true if and only if the designated bit is set.
BigIntegerxor(BigInteger val)Returns a BigInteger whose value is (this ^ val).

ReturnMethodSummary
doubledoubleValue()Converts this BigInteger to a double.
floatfloatValue()Converts this BigInteger to a float.
intintValue()Converts this BigInteger to an int.
longlongValue()Converts this BigInteger to a long.

ReturnMethodSummary
intcompareTo(BigInteger val)Compares this BigInteger with the specified BigInteger.
booleanequals(Object x)Compares this BigInteger with the specified Object for equality.
BigIntegermax(BigInteger val)Returns the maximum of this BigInteger and val.
BigIntegermin(BigInteger val)Returns the minimum of this BigInteger and val.

ReturnMethodSummary
StringtoString()Returns the decimal String representation of this BigInteger.
StringtoString(int radix)Returns the String representation of this BigInteger in the given radix.

ReturnMethodSummary
static BigIntegervalueOf(long val)Returns a BigInteger whose value is equal to that of the specified long.

ReturnMethodSummary
intsignum()Returns the signum function of this BigInteger.

ReturnMethodSummary
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.