Minor improvement to MathMan#isInteger

This commit is contained in:
dordsor21 2021-08-11 12:32:46 +01:00
parent 7d3a9ff36d
commit 8928556c1d
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -352,8 +352,18 @@ public class MathMan {
if (str.charAt(0) == '-') {
if (length == 1) {
return false;
//VERY basic check for >< int min/max value without spending time trying to parse the int
} else if (length > 11) {
return false;
} else if (length == 11 && str.charAt(0) > '2' && str.charAt(0) > '1') {
return false;
}
i = 1;
//VERY basic check for >< int min/max value without spending time trying to parse the int
} else if (length > 10) {
return false;
} else if (length == 10 && str.charAt(0) > '2' && str.charAt(0) > '1') {
return false;
}
for (; i < length; i++) {
char c = str.charAt(i);