Class AbstractBigIntegerParser

java.lang.Object
ch.randelshofer.fastdoubleparser.AbstractNumberParser
ch.randelshofer.fastdoubleparser.AbstractBigIntegerParser
Direct Known Subclasses:
JavaBigIntegerFromByteArray, JavaBigIntegerFromCharArray, JavaBigIntegerFromCharSequence

abstract class AbstractBigIntegerParser extends AbstractNumberParser
  • Field Details

    • 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:
    • 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:
    • 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:
  • Constructor Details

    • AbstractBigIntegerParser

      AbstractBigIntegerParser()
  • Method Details

    • hasManyDigits

      protected static boolean hasManyDigits(int length)
    • checkHexBigIntegerBounds

      protected static void checkHexBigIntegerBounds(int numDigits)
    • checkDecBigIntegerBounds

      protected static void checkDecBigIntegerBounds(int numDigits)