java.math
Class BigInteger
java.lang.Object
|
+--java.lang.Number
|
+--java.math.BigInteger
All Implemented Interfaces:
Comparable, Serializable
Written using on-line Java Platform 1.2 API Specification, as well
as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998) and
"Applied Cryptography, Second Edition" by Bruce Schneier (Wiley, 1996).
Based primarily on IntNum.java BitOps.java by Per Bothner
(found in Kawa 1.6.62).
Status: Believed complete and correct.
ONE
public static final BigInteger ONE
ZERO
public static final BigInteger ZERO
BigInteger
public BigInteger(byte[] val)
Parameters:
BigInteger
public BigInteger(int signum, byte[] magnitude)
Parameters:
BigInteger
public BigInteger(int bitLength, int certainty, java.util.Random rnd)
Parameters:
BigInteger
public BigInteger(int numBits, java.util.Random rnd)
Parameters:
BigInteger
public BigInteger(java.lang.String val)
Parameters:
BigInteger
public BigInteger(java.lang.String val, int radix)
Parameters:
abs
public BigInteger abs()
add
public BigInteger add(java.math.BigInteger val)
Parameters:
and
public BigInteger and(java.math.BigInteger y)
Return the logical (bit-wise) "and" of two BigIntegers.
Parameters:
andNot
public BigInteger andNot(java.math.BigInteger val)
Parameters:
bitCount
public int bitCount()
Count one bits in a BigInteger.
If argument is negative, count zero bits instead.
bitLength
public int bitLength()
Calculates ceiling(log2(this < 0 ? -this : this+1))
See Common Lisp: the Language, 2nd ed, p. 361.
clearBit
public BigInteger clearBit(int n)
Parameters:
compareTo
public int compareTo(java.lang.Object obj)
Parameters:
compareTo
public int compareTo(java.math.BigInteger val)
Parameters:
divide
public BigInteger divide(java.math.BigInteger val)
Parameters:
divideAndRemainder
public BigInteger[] divideAndRemainder(java.math.BigInteger val)
Parameters:
doubleValue
public double doubleValue()
equals
public boolean equals(java.lang.Object obj)
Parameters:
flipBit
public BigInteger flipBit(int n)
Parameters:
floatValue
public float floatValue()
gcd
public BigInteger gcd(java.math.BigInteger y)
Parameters:
getLowestSetBit
public int getLowestSetBit()
hashCode
public int hashCode()
intValue
public int intValue()
isProbablePrime
public boolean isProbablePrime(int certainty)
Returns true
if this BigInteger is probably prime,
false
if it's definitely composite. If certainty
is <= 0
, true
is returned.
Parameters:
Returns:
true
if this BigInteger is probably prime,
false
if it's definitely composite.
longValue
public long longValue()
max
public BigInteger max(java.math.BigInteger val)
Parameters:
min
public BigInteger min(java.math.BigInteger val)
Parameters:
mod
public BigInteger mod(java.math.BigInteger m)
Parameters:
modInverse
public BigInteger modInverse(java.math.BigInteger y)
Parameters:
modPow
public BigInteger modPow(java.math.BigInteger exponent, java.math.BigInteger m)
Parameters:
multiply
public BigInteger multiply(java.math.BigInteger y)
Parameters:
negate
public BigInteger negate()
not
public BigInteger not()
Return the logical (bit-wise) negation of a BigInteger.
or
public BigInteger or(java.math.BigInteger y)
Return the logical (bit-wise) "(inclusive) or" of two BigIntegers.
Parameters:
pow
public BigInteger pow(int exponent)
Calculate the integral power of a BigInteger.
Parameters:
remainder
public BigInteger remainder(java.math.BigInteger val)
Parameters:
setBit
public BigInteger setBit(int n)
Parameters:
shiftLeft
public BigInteger shiftLeft(int n)
Parameters:
shiftRight
public BigInteger shiftRight(int n)
Parameters:
signum
public int signum()
subtract
public BigInteger subtract(java.math.BigInteger val)
Parameters:
testBit
public boolean testBit(int n)
Parameters:
toByteArray
public byte[] toByteArray()
toString
public String toString()
toString
public String toString(int radix)
Parameters:
valueOf
public static BigInteger valueOf(long val)
Return a (possibly-shared) BigInteger with a given long value.
Parameters:
xor
public BigInteger xor(java.math.BigInteger y)
Return the logical (bit-wise) "exclusive or" of two BigIntegers.
Parameters: