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_RADIX
ROUND_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, trunc
add, compareTo, compareToImpl, compareToImpl2, divide, getDenominator, getNumerator, multiply, pow, powImpl, subtract
byteValue, compareTo, compareTo, equals, fitsByte, fitsDouble, fitsFloat, fitsInt, fitsLong, fitsShort, floatValue, getSign, intValue, pow, round, shortValue, toString
protected 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.Object
public IntegerNumber add(IntegerNumber n) throws java.lang.IllegalArgumentException
IntegerNumber
add
in class IntegerNumber
n
- 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
IntegerNumber
multiply
in class IntegerNumber
n
- 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
IntegerNumber
integerDivide
in class IntegerNumber
n
- 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()
RealNumber
long
. This may
involve rounding.longValue
in class RealNumber
long
.public double doubleValue()
RealNumber
double
. This may
involve rounding.doubleValue
in class RationalNumber
double
.public byte[] toByteArray()
IntegerNumber
toByteArray
in class IntegerNumber
public java.math.BigInteger toBigInteger()
IntegerNumber
BigInteger
.toBigInteger
in class IntegerNumber
BigInteger
with the value of this.