fix overflow check
This commit is contained in:
parent
6953dcfc3f
commit
6a072873ff
@ -1838,9 +1838,13 @@ public class FloatingDecimal{
|
||||
}
|
||||
|
||||
static ASCIIToBinaryConverter readDoubleSignlessDigits(int decExp, char[] digits, int length) {
|
||||
if (decExp < MIN_DECIMAL_EXPONENT) {
|
||||
return buildZero(BINARY_64_IX, 1);
|
||||
if (decExp < 0) {
|
||||
int kDigits = Math.min(length, MAX_DECIMAL_DIGITS + 1);
|
||||
if (decExp - kDigits > 0) {
|
||||
return buildZero(BINARY_64_IX, 1);
|
||||
}
|
||||
}
|
||||
|
||||
byte[] buf = new byte[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
buf[i] = (byte) digits[i];
|
||||
|
Loading…
x
Reference in New Issue
Block a user