Package com.google.common.primitives
Class UnsignedLongs.ParseOverflowDetection
- java.lang.Object
-
- com.google.common.primitives.UnsignedLongs.ParseOverflowDetection
-
- Enclosing class:
- UnsignedLongs
private static final class UnsignedLongs.ParseOverflowDetection extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static int[]
maxSafeDigits
(package private) static long[]
maxValueDivs
(package private) static int[]
maxValueMods
-
Constructor Summary
Constructors Modifier Constructor Description private
ParseOverflowDetection()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static boolean
overflowInParse(long current, int digit, int radix)
Returns true if (current * radix) + digit is a number too large to be represented by an unsigned long.
-
-
-
Method Detail
-
overflowInParse
static boolean overflowInParse(long current, int digit, int radix)
Returns true if (current * radix) + digit is a number too large to be represented by an unsigned long. This is useful for detecting overflow while parsing a string representation of a number. Does not verify whether supplied radix is valid, passing an invalid radix will give undefined results or an ArrayIndexOutOfBoundsException.
-
-