Class ExpandedDouble
java.lang.Object
org.xlsx4j.org.apache.poi.ss.util.ExpandedDouble
Represents a 64 bit IEEE double quantity expressed with both decimal and binary exponents
Does not handle negative numbers or zero
The value of a
a × 2b
where:
a = significand
b = binaryExponent - bitLength(significand) + 1
ExpandedDouble is given bya × 2b
where:
a = significand
b = binaryExponent - bitLength(significand) + 1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final BigIntegerAlways 64 bits long (MSB, bit-63 is '1')private static final BigIntegerprivate static final BigInteger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExpandedDoublefromRawBitsAndExponent(long rawBits, int exp) intprivate static BigIntegergetFrac(long rawBits) Convert to an equivalentNormalisedDecimalrepresentation having 15 decimal digits of precision in the non-fractional bits of the significand.
-
Field Details
-
BI_FRAC_MASK
-
BI_IMPLIED_FRAC_MSB
-
_significand
Always 64 bits long (MSB, bit-63 is '1') -
_binaryExponent
private final int _binaryExponent
-
-
Constructor Details
-
ExpandedDouble
public ExpandedDouble(long rawBits) -
ExpandedDouble
ExpandedDouble(BigInteger frac, int binaryExp)
-
-
Method Details
-
getFrac
-
fromRawBitsAndExponent
-
normaliseBaseTen
Convert to an equivalentNormalisedDecimalrepresentation having 15 decimal digits of precision in the non-fractional bits of the significand. -
getBinaryExponent
public int getBinaryExponent()- Returns:
- the number of non-fractional bits after the MSB of the significand
-
getSignificand
-