Java java.math BigInteger fields, constructors, methods, implement or subclass

Example usage for Java java.math BigInteger fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.math BigInteger.

The text is from its open source code.

Field

intsignum
The signum of this BigInteger: -1 for negative, 0 for zero, or 1 for positive.
BigIntegerZERO
The BigInteger constant zero.
BigIntegerONE
The BigInteger constant one.
BigIntegerTEN
The BigInteger constant ten.

Constructor

BigInteger(byte[] val)
Translates a byte array containing the two's-complement binary representation of a BigInteger into a BigInteger.
BigInteger(int[] val)
This private constructor translates an int array containing the two's-complement binary representation of a BigInteger into a BigInteger.
BigInteger(String val)
Translates the decimal String representation of a BigInteger into a BigInteger.
BigInteger(long val)
Constructs a BigInteger with the specified value, which may not be zero.
BigInteger(int signum, byte[] magnitude)
Translates the sign-magnitude representation of a BigInteger into a BigInteger.
BigInteger(int signum, int[] magnitude)
A constructor for internal use that translates the sign-magnitude 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.
BigInteger(int numBits, Random rnd)
Constructs a randomly generated BigInteger, uniformly distributed over the range 0 to (2 numBits - 1), inclusive.
BigInteger(int[] magnitude, int signum)
This internal constructor differs from its public cousin with the arguments reversed in two ways: it assumes that its arguments are correct, and it doesn't copy the magnitude array.
BigInteger(byte[] magnitude, int signum)
This private constructor is for internal use and assumes that its arguments are correct.
BigInteger(byte[] val, int off, int len)
Translates a byte sub-array containing the two's-complement binary representation of a BigInteger into a BigInteger.
BigInteger(char[] val, int sign, int len)
BigInteger(int bitLength, int certainty, Random rnd)
Constructs a randomly generated positive BigInteger that is probably prime, with the specified bitLength.

Method

BigIntegerabs()
Returns a BigInteger whose value is the absolute value of this BigInteger.
BigIntegeradd(BigInteger val)
Returns a BigInteger whose value is (this + val) .
BigIntegeradd(long val)
Package private methods used by BigDecimal code to add a BigInteger with a long.
BigIntegerand(BigInteger val)
Returns a BigInteger whose value is (this & val) .
BigIntegerandNot(BigInteger val)
Returns a BigInteger whose value is (this & ~val) .
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.
bytebyteValue()
Returns the value of the specified number as a byte .
BigIntegerclearBit(int n)
Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit cleared.
Objectclone()
Creates and returns a copy of this object.
intcompareTo(BigInteger val)
Compares this BigInteger with the specified BigInteger.
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) .
doubledoubleValue()
Converts this BigInteger to a double .
booleanequals(Object x)
Compares this BigInteger with the specified Object for equality.
BigIntegerflipBit(int n)
Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit flipped.
floatfloatValue()
Converts this BigInteger to a float .
BigIntegergcd(BigInteger val)
Returns a BigInteger whose value is the greatest common divisor of abs(this) and abs(val) .
ClassgetClass()
Returns the runtime class of this Object .
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).
inthashCode()
Returns the hash code for this BigInteger.
intintValue()
Converts this BigInteger to an int .
booleanisProbablePrime(int certainty)
Returns true if this BigInteger is probably prime, false if it's definitely composite.
longlongValue()
Converts this BigInteger to a long .
BigIntegermax(BigInteger val)
Returns the maximum of this BigInteger and val .
BigIntegermin(BigInteger val)
Returns the minimum of this BigInteger and 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) .
BigIntegermultiply(long v)
Package private methods used by BigDecimal code to multiply a BigInteger with a long.
BigIntegernegate()
Returns a BigInteger whose value is (-this) .
BigIntegernextProbablePrime()
Returns the first integer greater than this BigInteger that is probably prime.
BigIntegernot()
Returns a BigInteger whose value is (~this) .
BigIntegeror(BigInteger val)
Returns a BigInteger whose value is (this | val) .
BigIntegerpow(int exponent)
Returns a BigInteger whose value is (thisexponent).
BigIntegerprobablePrime(int bitLength, Random rnd)
Returns a positive BigInteger that is probably prime, with the specified bitLength.
BigIntegerremainder(BigInteger val)
Returns a BigInteger whose value is (this % val) .
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) .
shortshortValue()
Returns the value of the specified number as a short .
BigIntegersubtract(BigInteger val)
Returns a BigInteger whose value is (this - val) .
booleantestBit(int n)
Returns true if and only if the designated bit is set.
byte[]toByteArray()
Returns a byte array containing the two's-complement representation of this BigInteger.
StringtoString(int radix)
Returns the String representation of this BigInteger in the given radix.
StringtoString()
Returns the decimal String representation of this BigInteger.
BigIntegervalueOf(long val)
Returns a BigInteger whose value is equal to that of the specified long .
BigIntegervalueOf(int val[])
Returns a BigInteger with the given two's complement representation.
BigIntegerxor(BigInteger val)
Returns a BigInteger whose value is (this ^ val) .