Top Description Fields Constructors Methods
org.apache.poi.ss.util

pack-priv final Class ExpandedDouble

extends Object
Class Inheritance
Imports
java.math.BigInteger

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 ExpandedDouble is given by
a × 2b
where:
a = significand
b = binaryExponent - bitLength(significand) + 1

Field Summary

Modifier and TypeField and Description
private final int
private final BigInteger
_significand

Always 64 bits long (MSB, bit-63 is '1')

private static final BigInteger
private static final BigInteger

Constructor Summary

AccessConstructor and Description
public
ExpandedDouble(long rawBits)

pack-priv
ExpandedDouble(BigInteger frac, int binaryExp)

Method Summary

Modifier and TypeMethod and Description
public static ExpandedDouble
fromRawBitsAndExponent(long rawBits, int exp)

public int

Returns:

the number of non-fractional bits after the MSB of the significand
getBinaryExponent
()

private static BigInteger
getFrac(long rawBits)

public BigInteger
public NormalisedDecimal
normaliseBaseTen()

Convert to an equivalent NormalisedDecimal representation having 15 decimal digits of precision in the non-fractional bits of the significand.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_binaryExponentback to summary
private final int _binaryExponent
_significandback to summary
private final BigInteger _significand

Always 64 bits long (MSB, bit-63 is '1')

BI_FRAC_MASKback to summary
private static final BigInteger BI_FRAC_MASK
BI_IMPLIED_FRAC_MSBback to summary
private static final BigInteger BI_IMPLIED_FRAC_MSB

Constructor Detail

ExpandedDoubleback to summary
public ExpandedDouble(long rawBits)
ExpandedDoubleback to summary
pack-priv ExpandedDouble(BigInteger frac, int binaryExp)

Method Detail

fromRawBitsAndExponentback to summary
public static ExpandedDouble fromRawBitsAndExponent(long rawBits, int exp)
getBinaryExponentback to summary
public int getBinaryExponent()
Returns:int

the number of non-fractional bits after the MSB of the significand

getFracback to summary
private static BigInteger getFrac(long rawBits)
getSignificandback to summary
public BigInteger getSignificand()
normaliseBaseTenback to summary
public NormalisedDecimal normaliseBaseTen()

Convert to an equivalent NormalisedDecimal representation having 15 decimal digits of precision in the non-fractional bits of the significand.