public final class BasicDigitSet extends DigitSet
DigitSet
.MAXIMUM_RADIX
ROUND_CEILING, ROUND_DOWN, ROUND_FLOOR, ROUND_UP
Modifier | Constructor and Description |
---|---|
protected |
BasicDigitSet(boolean positive,
int radix,
int[] digits,
int exponent)
Creates a new
BasicDigitSet instance. |
Modifier and Type | Method and Description |
---|---|
int[] |
getDigits()
Returns a new array containing all the digits.
|
int |
getExponent()
Returns the exponent.
|
int |
getPrecision()
Returns the precision, the total number of digits.
|
int |
getRadix()
Returns the radix or base.
|
DigitSet |
toPrecisionImpl(int precision)
Returns a digit set with the specified precision, actual implementation.
|
toPrecision
add, add, compareTo, compareToImpl, compareToImpl, compareToImpl2, divide, divide, doubleValue, getDenominator, getNumerator, invert, multiply, multiply, negate, pow, powImpl, powImpl, subtract, subtract, toBigDecimal, toBigDecimal, trunc
abs, byteValue, compareTo, compareTo, equals, fitsByte, fitsDouble, fitsFloat, fitsInt, fitsLong, fitsShort, floatValue, getSign, intValue, longValue, pow, round, shortValue, toBigInteger, toString
protected BasicDigitSet(boolean positive, int radix, int[] digits, int exponent) throws java.lang.IllegalArgumentException
BasicDigitSet
instance.positive
- indication if the number is positive or not.radix
- the radix for the number, always >= 2 and <=
RealNumber.MAXIMUM_RADIX
.digits
- the digits, not null
.exponent
- the exponent for the number.java.lang.IllegalArgumentException
- if radix < 2
|| radix > RealNumber.MAXIMUM_RADIX
|| digits == null
|| digits[i] < 0 ||
|| digits[i] >= radix
,
where i >= 0 &&
i < digits.length
.public int getRadix()
DigitSet
public int getExponent()
DigitSet
getExponent
in class DigitSet
public int[] getDigits()
DigitSet
int
value between 0 (inclusive) and
the radix (exclusive).public int getPrecision()
DigitSet
getPrecision
in class DigitSet
public DigitSet toPrecisionImpl(int precision)
DigitSet
DigitSet.toPrecision(int)
.toPrecisionImpl
in class DigitSet
precision
- the precision, guaranteed to be >= 1 and <
DigitSet.getPrecision()
.DigitSet
that is equal to this number, truncated to
the specified precision.