Class AbstractBigIntegerParser

    • Field Detail

      • MAX_DECIMAL_DIGITS

        private static final int MAX_DECIMAL_DIGITS
        The resulting value must fit into 2^31 - 1 bits. The decimal representation of 2^31 - 1 bits has 646,456,993 digits.
        See Also:
        Constant Field Values
      • MAX_HEX_DIGITS

        private static final int MAX_HEX_DIGITS
        The resulting value must fit into 2^31 - 1 bits. The hexadecimal representation of 2^31 - 1 bits has 536,870,912 digits.
        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

      • AbstractBigIntegerParser

        AbstractBigIntegerParser()
    • Method Detail

      • hasManyDigits

        protected static boolean hasManyDigits​(int length)
      • checkHexBigIntegerBounds

        protected static void checkHexBigIntegerBounds​(int numDigits)
      • checkDecBigIntegerBounds

        protected static void checkDecBigIntegerBounds​(int numDigits)