mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-22 11:55:15 -04:00
catches a overseen RuntimeException; see #654
This commit is contained in:
parent
59a1577782
commit
160f9e80e8
@ -145,10 +145,14 @@ public final class Bits {
|
||||
if (str.indexOf(':') >= 0)
|
||||
return decodeFixed(str);
|
||||
if (str.indexOf('.') > -1) {
|
||||
if (str.endsWith("d") || str.endsWith("D"))
|
||||
return Double.doubleToLongBits(Double.parseDouble(str.substring(0, str.length() - 1)));
|
||||
else
|
||||
return Float.floatToIntBits(Float.parseFloat(str));
|
||||
try {
|
||||
if (str.endsWith("d") || str.endsWith("D"))
|
||||
return Double.doubleToLongBits(Double.parseDouble(str.substring(0, str.length() - 1)));
|
||||
else
|
||||
return Float.floatToIntBits(Float.parseFloat(str));
|
||||
} catch (java.lang.NumberFormatException e) {
|
||||
throw new NumberFormatException(str, 0);
|
||||
}
|
||||
}
|
||||
|
||||
int p = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user