Class ParseDigitsTaskCharSequence

java.lang.Object
ch.randelshofer.fastdoubleparser.ParseDigitsTaskCharSequence

final class ParseDigitsTaskCharSequence extends Object
Parses digits.
  • Constructor Details

    • ParseDigitsTaskCharSequence

      private ParseDigitsTaskCharSequence()
      Don't let anyone instantiate this class.
  • Method Details

    • parseDigitsIterative

      static BigInteger parseDigitsIterative(CharSequence str, int from, int to)
      Parses digits in quadratic time O(N2).
    • parseDigitsRecursive

      static BigInteger parseDigitsRecursive(CharSequence str, int from, int to, Map<Integer, BigInteger> powersOfTen, int recursionThreshold)
      Parses digits in O(N log N (log log N)) time.

      A conventional recursive algorithm would require O(N1.5). We achieve better performance by performing multiplications of long bit sequences in the frequency domain.