Class FastIntegerMath

java.lang.Object
ch.randelshofer.fastdoubleparser.FastIntegerMath

final class FastIntegerMath extends Object
  • Field Details

    • FIVE

      public static final BigInteger FIVE
    • TEN_POW_16

      static final BigInteger TEN_POW_16
    • FIVE_POW_16

      static final BigInteger FIVE_POW_16
    • SMALL_POWERS_OF_TEN

      private static final BigInteger[] SMALL_POWERS_OF_TEN
  • Constructor Details

    • FastIntegerMath

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

    • computePowerOfTen

      static BigInteger computePowerOfTen(NavigableMap<Integer, BigInteger> powersOfTen, int n)
      Computes the n-th power of ten.
      Parameters:
      powersOfTen - A map with pre-computed powers of ten
      n - the power
      Returns:
      the computed power of ten
    • computeTenRaisedByNFloor16Recursive

      static BigInteger computeTenRaisedByNFloor16Recursive(NavigableMap<Integer, BigInteger> powersOfTen, int n)
      Computes 10ninvalid input: '&'~15.
    • createPowersOfTenFloor16Map

      static NavigableMap<Integer, BigInteger> createPowersOfTenFloor16Map()
    • estimateNumBits

      public static long estimateNumBits(long numDecimalDigits)
    • fillPowersOf10Floor16

      static NavigableMap<Integer, BigInteger> fillPowersOf10Floor16(int from, int to)
      Fills a map with powers of 10 floor 16.
      Parameters:
      from - the start index of the character sequence that contains the digits
      to - the end index of the character sequence that contains the digits
      Returns:
      the filled map
    • fillPowersOfNFloor16Recursive

      static void fillPowersOfNFloor16Recursive(NavigableMap<Integer, BigInteger> powersOfTen, int from, int to)
    • unsignedMultiplyHigh

      static long unsignedMultiplyHigh(long x, long y)
    • splitFloor16

      static int splitFloor16(int from, int to)
      Finds middle of range with upper range half rounded up to multiple of 16.
      Parameters:
      from - start of range (inclusive)
      to - end of range (exclusive)
      Returns:
      middle of range with upper range half rounded up to multiple of 16