Package ch.randelshofer.fastdoubleparser
Class FastIntegerMath
java.lang.Object
ch.randelshofer.fastdoubleparser.FastIntegerMath
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BigInteger(package private) static final BigIntegerprivate static final BigInteger[](package private) static final BigInteger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static BigIntegercomputePowerOfTen(NavigableMap<Integer, BigInteger> powersOfTen, int n) Computes the n-th power of ten.(package private) static BigIntegercomputeTenRaisedByNFloor16Recursive(NavigableMap<Integer, BigInteger> powersOfTen, int n) Computes 10ninvalid input: '&'~15.(package private) static NavigableMap<Integer, BigInteger> static longestimateNumBits(long numDecimalDigits) (package private) static NavigableMap<Integer, BigInteger> fillPowersOf10Floor16(int from, int to) Fills a map with powers of 10 floor 16.(package private) static voidfillPowersOfNFloor16Recursive(NavigableMap<Integer, BigInteger> powersOfTen, int from, int to) (package private) static intsplitFloor16(int from, int to) Finds middle of range with upper range half rounded up to multiple of 16.(package private) static longunsignedMultiplyHigh(long x, long y)
-
Field Details
-
FIVE
-
TEN_POW_16
-
FIVE_POW_16
-
SMALL_POWERS_OF_TEN
-
-
Constructor Details
-
FastIntegerMath
private FastIntegerMath()Don't let anyone instantiate this class.
-
-
Method Details
-
createPowersOfTenFloor16Map
-
estimateNumBits
public static long estimateNumBits(long numDecimalDigits) -
fillPowersOf10Floor16
Fills a map with powers of 10 floor 16.- Parameters:
from- the start index of the character sequence that contains the digitsto- the end index of the character sequence that contains the digits- Returns:
- the filled map
-
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