Skip to content

Commit

Permalink
Disable the usage of Double in favor of BigDecimal
Browse files Browse the repository at this point in the history
  • Loading branch information
svanteschubert committed Nov 14, 2020
1 parent 68c538a commit fe8ca45
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/main/java/net/sf/saxon/value/NumericValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@ public abstract class NumericValue extends AtomicValue

/*@NotNull*/
public static NumericValue parseNumber(/*@NotNull*/ String in) {
if (in.indexOf('e') >= 0 || in.indexOf('E') >= 0) {
try {
return new DoubleValue(Double.parseDouble(in));
} catch (NumberFormatException e) {
return DoubleValue.NaN;
}
} else if (in.indexOf('.') >= 0) {
if (in.indexOf('e') >= 0 || in.indexOf('E') >= 0 || in.indexOf('.') >= 0) {
ConversionResult v = BigDecimalValue.makeDecimalValue(in, true);
if (v instanceof ValidationFailure) {
return DoubleValue.NaN;
Expand Down

0 comments on commit fe8ca45

Please sign in to comment.