Class AbstractBigDecimalParser

    • Field Detail

      • MANY_DIGITS_THRESHOLD

        public 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 Integer.MAX_VALUE if you only want to use the algorithm optimised for few digits in the significand.

        Set this to 0 if you only want to use the algorithm for long inputs.

        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
         
        See Also:
        Constant Field Values
      • RECURSION_THRESHOLD

        static final int RECURSION_THRESHOLD
        Threshold on the number of digits for selecting the recursive algorithm instead of the iterative algorithm.

        Set this to Integer.MAX_VALUE if you only want to use the iterative algorithm.

        Set this to 0 if you only want to use the recursive algorithm.

        Rationale for choosing a specific threshold value: The iterative algorithm has a smaller constant overhead than the recursive algorithm. We speculate that we break even somewhere at twice the threshold value.

        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractBigDecimalParser

        AbstractBigDecimalParser()
    • Method Detail

      • hasManyDigits

        protected static boolean hasManyDigits​(int length)
      • checkParsedBigDecimalBounds

        protected static void checkParsedBigDecimalBounds​(boolean illegal,
                                                          int index,
                                                          int endIndex,
                                                          int digitCount,
                                                          long exponent)