public final class BasicDigitSet extends DigitSet
DigitSet.MAXIMUM_RADIXROUND_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.
|
toPrecisionadd, add, compareTo, compareToImpl, compareToImpl, compareToImpl2, divide, divide, doubleValue, getDenominator, getNumerator, invert, multiply, multiply, negate, pow, powImpl, powImpl, subtract, subtract, toBigDecimal, toBigDecimal, truncabs, byteValue, compareTo, compareTo, equals, fitsByte, fitsDouble, fitsFloat, fitsInt, fitsLong, fitsShort, floatValue, getSign, intValue, longValue, pow, round, shortValue, toBigInteger, toStringprotected 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()
DigitSetpublic int getExponent()
DigitSetgetExponent in class DigitSetpublic int[] getDigits()
DigitSetint value between 0 (inclusive) and
the radix (exclusive).public int getPrecision()
DigitSetgetPrecision in class DigitSetpublic DigitSet toPrecisionImpl(int precision)
DigitSetDigitSet.toPrecision(int).toPrecisionImpl in class DigitSetprecision - the precision, guaranteed to be >= 1 and <
DigitSet.getPrecision().DigitSet that is equal to this number, truncated to
the specified precision.