public final class BigIntegerNumber extends IntegerNumber
java.math.BigInteger. It can hold all values from
-2**32 to (2**32 - 1).
Instances must be obtained by using the
createInstance() factory method.BigInteger,
Serialized FormMAXIMUM_RADIXROUND_CEILING, ROUND_DOWN, ROUND_FLOOR, ROUND_UP| Modifier | Constructor and Description |
|---|---|
protected |
BigIntegerNumber(java.math.BigInteger n)
Constructs a
BigIntegerNumber from a
BigInteger. |
| Modifier and Type | Method and Description |
|---|---|
IntegerNumber |
add(IntegerNumber n)
Computes this + n, where n is an integer number.
|
static BigIntegerNumber |
createInstance(java.math.BigInteger n)
Returns an instance of a
BigIntegerNumber based on a
java.math.BigInteger. |
double |
doubleValue()
Returns the value of this number as a
double. |
int |
hashCode() |
IntegerNumber |
integerDivide(IntegerNumber n)
Computes the integer result of this/n, where n is an
integer number.
|
long |
longValue()
Returns the value of this number as a
long. |
IntegerNumber |
multiply(IntegerNumber n)
Computes this * n, where n is an integer number.
|
protected RationalNumber |
powImpl(int exponent) |
java.math.BigInteger |
toBigInteger()
Converts the value of this number to a
BigInteger. |
byte[] |
toByteArray()
Returns the two's-complement representation of this integer number.
|
abs, absInteger, add, compareTo, compareToImpl, compareToImpl, dec, divide, fac, gcd, inc, invert, isRelativePrime, multiply, negate, negateInteger, powImpl, remainder, subtract, subtract, toBigDecimal, toBigDecimal, toBigDecimal, truncadd, compareTo, compareToImpl, compareToImpl2, divide, getDenominator, getNumerator, multiply, pow, powImpl, subtractbyteValue, compareTo, compareTo, equals, fitsByte, fitsDouble, fitsFloat, fitsInt, fitsLong, fitsShort, floatValue, getSign, intValue, pow, round, shortValue, toStringprotected BigIntegerNumber(java.math.BigInteger n)
throws java.lang.IllegalArgumentException
BigIntegerNumber from a
BigInteger.n - the value for the new number, not null.java.lang.IllegalArgumentException - if n == null.public static BigIntegerNumber createInstance(java.math.BigInteger n) throws java.lang.IllegalArgumentException
BigIntegerNumber based on a
java.math.BigInteger.n - the BigInteger to construct a BigIntegerNumber
from.BigIntegerNumber
instance.java.lang.IllegalArgumentException - if n == null.public int hashCode()
hashCode in class java.lang.Objectpublic IntegerNumber add(IntegerNumber n) throws java.lang.IllegalArgumentException
IntegerNumberadd in class IntegerNumbern - the number to add to this, not null.null.java.lang.IllegalArgumentException - if the argument is
null.public IntegerNumber multiply(IntegerNumber n) throws java.lang.IllegalArgumentException
IntegerNumbermultiply in class IntegerNumbern - the number to multiply this by, not null.null.java.lang.IllegalArgumentException - if n == null.public IntegerNumber integerDivide(IntegerNumber n) throws java.lang.ArithmeticException, java.lang.IllegalArgumentException
IntegerNumberintegerDivide in class IntegerNumbern - the number to divide this by.java.lang.ArithmeticException - if the value of the argument number is
zero.java.lang.IllegalArgumentException - if the argument is
null.protected RationalNumber powImpl(int exponent)
public long longValue()
RealNumberlong. This may
involve rounding.longValue in class RealNumberlong.public double doubleValue()
RealNumberdouble. This may
involve rounding.doubleValue in class RationalNumberdouble.public byte[] toByteArray()
IntegerNumbertoByteArray in class IntegerNumberpublic java.math.BigInteger toBigInteger()
IntegerNumberBigInteger.toBigInteger in class IntegerNumberBigInteger with the value of this.