BinaryToASCIIBuffer
instance may be obtained.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final FloatingDecimal. | |
| private static final FloatingDecimal. | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int[] | |
| private static final int[] | |
| private static final long | |
| private static final int | |
| private static final int | |
| private static final long | |
| private static final int[] | |
| private static final String | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final String | |
| private static final String | |
| private static final int[] | |
| private static final int[] | |
| private static final int[] | |
| private static final int[] | |
| private static final int | |
| private static final ThreadLocal |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static long | |
| private static double | |
| private static float | |
| private static void | |
| private static int | |
| private static void | |
| private static int | |
| private static FloatingDecimal. | |
| public static FloatingDecimal. | Returns: The converter.The double precision value to convert. d, boolean compatibility with releases < JDK 21 compat)Returns a |
| private static FloatingDecimal. | |
| private static FloatingDecimal. | |
| private static boolean | |
| public static double | Returns: The double precision value.The s)String to convert.Converts a |
| public static double | Returns: The double-precision value of the conversionThe decimal exponent of the value to generate decExp, byte[] The digits of the significand. d, int Number of digits to use length)Converts a sequence of digits ('0'-'9') as well as an exponent to a positive double value |
| public static float | Returns: The single precision value.The s)String to convert.Converts a |
| private static double | Returns: an appropriate binary converterthe non-null input in, int one of the ix)BINARY_<S>_IX constants, where <S>
is one of 16, 32, 64The input must match the |
| private static void | |
| private static int | |
| private static int |
| B2AC_NEGATIVE_ZERO | back to summary |
|---|---|
| private static final FloatingDecimal. | |
| B2AC_POSITIVE_ZERO | back to summary |
|---|---|
| private static final FloatingDecimal. | |
| BINARY_16_IX | back to summary |
|---|---|
| private static final int BINARY_16_IX | |
| BINARY_32_IX | back to summary |
|---|---|
| private static final int BINARY_32_IX | |
| BINARY_64_IX | back to summary |
|---|---|
| private static final int BINARY_64_IX | |
| E_THR_I | back to summary |
|---|---|
| private static final int[] E_THR_I
| |
| E_THR_Z | back to summary |
|---|---|
| private static final int[] E_THR_Z
| |
| EXP_ONE | back to summary |
|---|---|
| private static final long EXP_ONE | |
| EXP_SHIFT | back to summary |
|---|---|
| private static final int EXP_SHIFT | |
| FLOG_10_MAX_LONG | back to summary |
|---|---|
| private static final int FLOG_10_MAX_LONG | |
| FRACT_HOB | back to summary |
|---|---|
| private static final long FRACT_HOB | |
| HEX_COUNT | back to summary |
|---|---|
| private static final int[] HEX_COUNT
| |
| INFINITY_REP | back to summary |
|---|---|
| private static final String INFINITY_REP | |
| L_HALF | back to summary |
|---|---|
| private static final int L_HALF | |
| MAX_DEC_DIGITS | back to summary |
|---|---|
| private static final int MAX_DEC_DIGITS | |
| MAX_OUT | back to summary |
|---|---|
| private static final int MAX_OUT | |
| MAX_SMALL_BIN_EXP | back to summary |
|---|---|
| private static final int MAX_SMALL_BIN_EXP | |
| MIN_SMALL_BIN_EXP | back to summary |
|---|---|
| private static final int MIN_SMALL_BIN_EXP | |
| NAN_REP | back to summary |
|---|---|
| private static final String NAN_REP | |
| OMITTED | back to summary |
|---|---|
| private static final String OMITTED | |
| P | back to summary |
|---|---|
| private static final int[] P
| |
| Q_MIN | back to summary |
|---|---|
| private static final int[] Q_MIN
| |
| QP_MAX | back to summary |
|---|---|
| private static final int[] QP_MAX
| |
| QP_MIN | back to summary |
|---|---|
| private static final int[] QP_MIN
| |
| R_HALF | back to summary |
|---|---|
| private static final int R_HALF | |
| threadLocalBinaryToASCIIBuffer | back to summary |
|---|---|
| private static final ThreadLocal<FloatingDecimal. | |
| FloatingDecimal | back to summary |
|---|---|
| public FloatingDecimal() | |
| appendDecDigit | back to summary |
|---|---|
| private static long appendDecDigit(long v, int ch) | |
| buildDouble | back to summary |
|---|---|
| private static double buildDouble(int ssign, int q, long c) | |
| buildFloat | back to summary |
|---|---|
| private static float buildFloat(int ssign, int q, long c) | |
| check | back to summary |
|---|---|
| private static void check(String in, boolean expected) | |
| checkMultiplePoints | back to summary |
|---|---|
| private static int checkMultiplePoints(int pt, int i) | |
| copyDigits | back to summary |
|---|---|
| private static void copyDigits(String in, byte[] d, int len, int i) | |
| digitFor | back to summary |
|---|---|
| private static int digitFor(int ch) | |
| getBinaryToASCIIBuffer | back to summary |
|---|---|
| private static FloatingDecimal. | |
| getBinaryToASCIIConverter | back to summary |
|---|---|
| public static FloatingDecimal. Returns a
| |
| getBinaryToASCIIConverter | back to summary |
|---|---|
| private static FloatingDecimal. | |
| getCompatBinaryToASCIIConverter | back to summary |
|---|---|
| private static FloatingDecimal. | |
| isDigit | back to summary |
|---|---|
| private static boolean isDigit(int ch, boolean isDec) | |
| parseDouble | back to summary |
|---|---|
| public static double parseDouble(String s) throws NumberFormatException Converts a
| |
| parseDoubleSignlessDigits | back to summary |
|---|---|
| public static double parseDoubleSignlessDigits(int decExp, byte[] d, int length) Converts a sequence of digits ('0'-'9') as well as an exponent to a positive double value
| |
| parseFloat | back to summary |
|---|---|
| public static float parseFloat(String s) throws NumberFormatException Converts a
| |
| readJavaFormatString | back to summary |
|---|---|
| private static double readJavaFormatString(String in, int ix) The input must match the
| |
| scanSymbolic | back to summary |
|---|---|
| private static void scanSymbolic(String in, int i, String sub) | |
| skipWhitespaces | back to summary |
|---|---|
| private static int skipWhitespaces(String in, int i) | |
| toLowerCase | back to summary |
|---|---|
| private static int toLowerCase(int ch) | |
| Modifier and Type | Field and Description |
|---|---|
| private final byte[] | |
| private final int | |
| private final boolean | |
| private static final int | |
| private final int | |
| private static final int | |
| private static final float[] | |
| private static final double[] |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private double | |
| private float | |
| private double | |
| private float | |
| private long |
| d | back to summary |
|---|---|
| private final byte[] d | |
| e | back to summary |
|---|---|
| private final int e | |
| isNegative | back to summary |
|---|---|
| private final boolean isNegative | |
| MAX_SMALL_TEN | back to summary |
|---|---|
| private static final int MAX_SMALL_TEN | |
| n | back to summary |
|---|---|
| private final int n | |
| SINGLE_MAX_SMALL_TEN | back to summary |
|---|---|
| private static final int SINGLE_MAX_SMALL_TEN | |
| SINGLE_SMALL_10_POW | back to summary |
|---|---|
| private static final float[] SINGLE_SMALL_10_POW
| |
| SMALL_10_POW | back to summary |
|---|---|
| private static final double[] SMALL_10_POW
| |
| ASCIIToBinaryBuffer | back to summary |
|---|---|
| private ASCIIToBinaryBuffer(boolean isNegative, int e, byte[] d, int n) | |
| doubleValue | back to summary |
|---|---|
| private double doubleValue() | |
| floatValue | back to summary |
|---|---|
| private float floatValue() | |
| signed | back to summary |
|---|---|
| private double signed(double v) | |
| signed | back to summary |
|---|---|
| private float signed(float v) | |
| toLong | back to summary |
|---|---|
| private long toLong(int n) | |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private boolean | |
| private final byte[] | |
| private boolean | |
| private int | |
| private static final int[] | insignificantDigitsNumber
If insignificant==(1L << ixd) i = insignificantDigitsNumber[idx] is the same as: int i; for ( i = 0; insignificant >= 10L; i++ ) insignificant /= 10L; |
| private static final int[] | |
| private int |
| Access | Constructor and Description |
|---|---|
| private | BinaryToASCIIBuffer()
Default constructor; used for non-zero values,
|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| private void | developLongDigits(long lvalue, int insignificantDigits)
This is the easy subcase -- all the significant bits, after scaling, are held in lvalue. |
| public boolean | |
| private void | |
| private static int | |
| public int | |
| public int | |
| private static int | |
| private void |
| decExponent | back to summary |
|---|---|
| private int decExponent | |
| decimalDigitsRoundedUp | back to summary |
|---|---|
| private boolean decimalDigitsRoundedUp | |
| digits | back to summary |
|---|---|
| private final byte[] digits | |
| exactDecimalConversion | back to summary |
|---|---|
| private boolean exactDecimalConversion | |
| firstDigitIndex | back to summary |
|---|---|
| private int firstDigitIndex | |
| insignificantDigitsNumber | back to summary |
|---|---|
| private static final int[] insignificantDigitsNumber If insignificant==(1L << ixd) i = insignificantDigitsNumber[idx] is the same as: int i; for ( i = 0; insignificant >= 10L; i++ ) insignificant /= 10L; | |
| N_5_BITS | back to summary |
|---|---|
| private static final int[] N_5_BITS
| |
| nDigits | back to summary |
|---|---|
| private int nDigits | |
| BinaryToASCIIBuffer | back to summary |
|---|---|
| private BinaryToASCIIBuffer() Default constructor; used for non-zero values,
| |
| BinaryToASCIIBuffer | back to summary |
|---|---|
| private BinaryToASCIIBuffer(byte[] digits) Creates a specialized value (positive and negative zeros). | |
| decimalDigitsExact | back to summary |
|---|---|
| public boolean decimalDigitsExact() | |
| developLongDigits | back to summary |
|---|---|
| private void developLongDigits(long lvalue, int insignificantDigits) This is the easy subcase -- all the significant bits, after scaling, are held in lvalue. negSign and decExponent tell us what processing and scaling has already been done. Exceptional cases have already been stripped out. In particular: lvalue is a finite number (not Inf, nor NaN) lvalue > 0L (not zero, nor negative). The only reason that we develop the digits here, rather than calling on Long.toString() is that we can do it a little faster, and besides want to treat trailing 0s specially. If Long.toString changes, we should re-evaluate this strategy! | |
| digitsRoundedUp | back to summary |
|---|---|
| public boolean digitsRoundedUp() | |
| dtoa | back to summary |
|---|---|
| private void dtoa(int binExp, long fractBits, int nSignificantBits) | |
| estimateDecExp | back to summary |
|---|---|
| private static int estimateDecExp(long fractBits, int binExp) Estimate decimal exponent. (If it is small-ish, we could double-check.) First, scale the mantissa bits such that 1 <= d2 < 2. We are then going to estimate log10(d2) ~=~ (d2-1.5)/1.5 + log(1.5) and so we can estimate log10(d) ~=~ log10(d2) + binExp * log10(2) take the floor and call it decExp. | |
| getDecimalExponent | back to summary |
|---|---|
| public int getDecimalExponent() | |
| getDigits | back to summary |
|---|---|
| public int getDigits(byte[] digits) | |
| insignificantDigitsForPow2 | back to summary |
|---|---|
| private static int insignificantDigitsForPow2(int p2) Calculates | |
| roundup | back to summary |
|---|---|
| private void roundup() | |