- java.lang.Object
-
- org.jfree.svg.util.RyuDouble
-
public final class RyuDouble extends java.lang.ObjectAn implementation of Ryu for double.
-
-
Field Summary
Fields Modifier and Type Field Description private static booleanDEBUGprivate static intDOUBLE_EXPONENT_BIASprivate static intDOUBLE_EXPONENT_BITSprivate static intDOUBLE_EXPONENT_MASKprivate static intDOUBLE_MANTISSA_BITSprivate static longDOUBLE_MANTISSA_MASKprivate static intNEG_TABLE_SIZEprivate static intPOS_TABLE_SIZEprivate static java.math.BigInteger[]POW5private static intPOW5_BITCOUNTprivate static java.math.BigInteger[]POW5_INVprivate static intPOW5_INV_BITCOUNTprivate static intPOW5_INV_QUARTER_BITCOUNTprivate static int[][]POW5_INV_SPLITprivate static intPOW5_QUARTER_BITCOUNTprivate static int[][]POW5_SPLIT
-
Constructor Summary
Constructors Constructor Description RyuDouble()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static intdecimalLength(long v)static java.lang.StringdoubleToString(double value)static java.lang.StringdoubleToString(double value, RoundingMode roundingMode)private static longmulPow5divPow2(long m, int i, int j)Compute the high digits of m * 5^p / 10^q = m * 5^(p - q) / 2^q = m * 5^i / 2^j, with q chosen such that m * 5^i / 2^j has sufficiently many decimal digits to represent the original floating point number.private static longmulPow5InvDivPow2(long m, int i, int j)Compute the high digits of m / 5^i / 2^j such that the result is accurate to at least 9 decimal digits.private static booleanmultipleOfPowerOf5(long value, int q)private static intpow5bits(int e)private static intpow5Factor(long value)
-
-
-
Field Detail
-
DEBUG
private static boolean DEBUG
-
DOUBLE_MANTISSA_BITS
private static final int DOUBLE_MANTISSA_BITS
- See Also:
- Constant Field Values
-
DOUBLE_MANTISSA_MASK
private static final long DOUBLE_MANTISSA_MASK
- See Also:
- Constant Field Values
-
DOUBLE_EXPONENT_BITS
private static final int DOUBLE_EXPONENT_BITS
- See Also:
- Constant Field Values
-
DOUBLE_EXPONENT_MASK
private static final int DOUBLE_EXPONENT_MASK
- See Also:
- Constant Field Values
-
DOUBLE_EXPONENT_BIAS
private static final int DOUBLE_EXPONENT_BIAS
- See Also:
- Constant Field Values
-
POS_TABLE_SIZE
private static final int POS_TABLE_SIZE
- See Also:
- Constant Field Values
-
NEG_TABLE_SIZE
private static final int NEG_TABLE_SIZE
- See Also:
- Constant Field Values
-
POW5
private static final java.math.BigInteger[] POW5
-
POW5_INV
private static final java.math.BigInteger[] POW5_INV
-
POW5_BITCOUNT
private static final int POW5_BITCOUNT
- See Also:
- Constant Field Values
-
POW5_QUARTER_BITCOUNT
private static final int POW5_QUARTER_BITCOUNT
- See Also:
- Constant Field Values
-
POW5_SPLIT
private static final int[][] POW5_SPLIT
-
POW5_INV_BITCOUNT
private static final int POW5_INV_BITCOUNT
- See Also:
- Constant Field Values
-
POW5_INV_QUARTER_BITCOUNT
private static final int POW5_INV_QUARTER_BITCOUNT
- See Also:
- Constant Field Values
-
POW5_INV_SPLIT
private static final int[][] POW5_INV_SPLIT
-
-
Method Detail
-
doubleToString
public static java.lang.String doubleToString(double value)
-
doubleToString
public static java.lang.String doubleToString(double value, RoundingMode roundingMode)
-
pow5bits
private static int pow5bits(int e)
-
decimalLength
private static int decimalLength(long v)
-
multipleOfPowerOf5
private static boolean multipleOfPowerOf5(long value, int q)
-
pow5Factor
private static int pow5Factor(long value)
-
mulPow5divPow2
private static long mulPow5divPow2(long m, int i, int j)Compute the high digits of m * 5^p / 10^q = m * 5^(p - q) / 2^q = m * 5^i / 2^j, with q chosen such that m * 5^i / 2^j has sufficiently many decimal digits to represent the original floating point number.
-
mulPow5InvDivPow2
private static long mulPow5InvDivPow2(long m, int i, int j)Compute the high digits of m / 5^i / 2^j such that the result is accurate to at least 9 decimal digits. i and j are already chosen appropriately.
-
-