The representation of a number that can accommodate the range of doubles and longs without loss of precision.
| double |
asDouble()
Returns the double representation of this NumberParts,
|
| long |
asLong()
Returns the long representation of this NumberParts,
|
| static NumberParts |
create(boolean negative, int exponent, long significand)
|
| boolean | |
| int |
exponent()
The actual value of the binary exponent in the floating point encoding.
|
| static NumberParts |
fromDouble(double value)
Returns the NumberParts representation of the given double.
|
| static NumberParts |
fromLong(long value)
Returns the NumberParts representation of the given long.
|
| int |
hashCode()
|
| boolean |
isInfinite()
Returns whether this NumberParts represent an infinity (positive or negative).
|
| boolean |
isNaN()
Returns whether this NumberParts represents NaN.
|
| boolean |
isZero()
Returns whether this NumberParts represents 0.
|
| NumberParts |
negate()
Returns this NumberParts with the sign flipped.
|
| boolean |
negative()
True if the number was overall negative (i.e.
|
| boolean |
representableAsDouble()
Returns whether or not this NumberParts can be represented as a double without loss of
precision.
|
| boolean |
representableAsLong()
Returns whether or not this NumberParts can be represented as a long without loss of precision.
|
| long |
significand()
The value of the significand in the floating point encoding, left justified, with a hidden
leading one bit.
|
Returns the double representation of this NumberParts,
| IllegalArgumentException | if this would lead to a loss of precision. |
|---|
Returns the long representation of this NumberParts,
| IllegalArgumentException | if this is not representable as a long. |
|---|
| negative | |
|---|---|
| exponent | |
| significand |
The actual value of the binary exponent in the floating point encoding.
Returns the NumberParts representation of the given double.
| value |
|---|
Returns the NumberParts representation of the given long.
| value |
|---|
Returns whether this NumberParts represent an infinity (positive or negative).
Returns whether this NumberParts represents NaN.
There is only one NaN representation in NumberParts (unlike double).
Returns whether this NumberParts represents 0.
There is only one zero representation in NumberParts (unlike double, which has both negative and positive zero).
Returns this NumberParts with the sign flipped.
Returns the same instance for zero (negative 0 is not representable in NumberParts) and NaN.
True if the number was overall negative (i.e. less than zero).
Returns whether or not this NumberParts can be represented as a double without loss of precision.
Returns whether or not this NumberParts can be represented as a long without loss of precision.
The value of the significand in the floating point encoding, left justified, with a hidden leading one bit.