double from a byte array.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | MANY_DIGITS_THRESHOLD
Threshold on the number of input characters for selecting the algorithm optimised for few digits in the significand vs. the algorithm for many digits in the significand. |
| private static final int | |
| private static final long | |
| public static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public BigDecimal | Returns: the parsedBigDecimalthe input string str, int start of the input data offset, int length of the input data length)Parses a |
| pack-priv BigDecimal | parseBigDecimalStringWithManyDigits(char[] str, int offset, int length)
Parses a big decimal string that has many digits. |
| private BigDecimal | Returns: the parsed big decimalthe input string str, int the start index of the integer part of the significand integerPartIndex, int the index of the decimal point in the significand (same as exponentIndicatorIndex
if there is no decimal point) decimalPointIndex, int the start index of the non-zero fractional part of the significand nonZeroFractionalPartIndex, int the index of the exponent indicator (same as end of string if there is no
exponent indicator) exponentIndicatorIndex, boolean indicates that the significand is negative isNegative, int the exponent value exponent)Parses a big decimal string after we have identified the parts of the significand, and after we have obtained the exponent value. |
| MANY_DIGITS_THRESHOLD | back to summary |
|---|---|
| private static final int MANY_DIGITS_THRESHOLD Threshold on the number of input characters for selecting the algorithm optimised for few digits in the significand vs. the algorithm for many digits in the significand.
Set this to
Set this to Rationale for choosing a specific threshold value: We speculate that we only need to use the algorithm for large inputs if there is zero chance, that we can parse the input with the algorithm for small inputs. optional significant sign = 1 18 significant digits = 18 optional decimal point in significant = 1 optional exponent = 1 optional exponent sign = 1 10 exponent digits = 10 | |
| MAX_DIGIT_COUNT | back to summary |
|---|---|
| private static final int MAX_DIGIT_COUNT See | |
| MAX_EXPONENT_NUMBER | back to summary |
|---|---|
| private static final long MAX_EXPONENT_NUMBER | |
| MAX_INPUT_LENGTH | back to summary |
|---|---|
| public static final int MAX_INPUT_LENGTH | |
| JavaBigDecimalFromCharArray | back to summary |
|---|---|
| public JavaBigDecimalFromCharArray() Creates a new instance. | |
| parseBigDecimalString | back to summary |
|---|---|
| public BigDecimal parseBigDecimalString(char[] str, int offset, int length) Parses a
| |
| parseBigDecimalStringWithManyDigits | back to summary |
|---|---|
| pack-priv BigDecimal parseBigDecimalStringWithManyDigits(char[] str, int offset, int length) Parses a big decimal string that has many digits. | |
| valueOfBigDecimalString | back to summary |
|---|---|
| private BigDecimal valueOfBigDecimalString(char[] str, int integerPartIndex, int decimalPointIndex, int nonZeroFractionalPartIndex, int exponentIndicatorIndex, boolean isNegative, int exponent) Parses a big decimal string after we have identified the parts of the significand, and after we have obtained the exponent value.
integerPartIndex
│ decimalPointIndex
│ │ nonZeroFractionalPartIndex
│ │ │ exponentIndicatorIndex
↓ ↓ ↓ ↓
"-123.00456e-789"
| |