You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix issue #80: Bug in large array size inputs for JavaBigDecimalParser.parseBigDecimal.
AbstractBigDecimalParserTest.java:
- Add a test for the input value that reproduces the problem.
JavaBigDecimalFromByteArray.java,
JavaBigDecimalFromCharArray.java,
JavaBigDecimalFromCharSequence.java:
- Fix the off-by-one issue in JavaBigDecimalFromCharArray.
- Harmonize the code in all 3 implementations.
Strings.java,
FftMultiplierTest.java,
JmhBigDecimalScalability.java,
JmhDoubleScalability.java,
JmhJavaBigIntegerFromByteArrayScalability.java,
JmhJavaDoubleFromCharSequenceScalability.java:
- Implement a better method for creating Strings from repeated characters.
Copy file name to clipboardExpand all lines: fastdoubleparser-dev/src/main/java/ch.randelshofer.fastdoubleparser/ch/randelshofer/fastdoubleparser/JavaBigDecimalFromByteArray.java
+9-8Lines changed: 9 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -146,8 +146,8 @@ public BigDecimal parseBigDecimalString(byte[] str, int offset, int length) {
Copy file name to clipboardExpand all lines: fastdoubleparser-dev/src/main/java/ch.randelshofer.fastdoubleparser/ch/randelshofer/fastdoubleparser/JavaBigDecimalFromCharArray.java
+11-10Lines changed: 11 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -141,8 +141,8 @@ public BigDecimal parseBigDecimalString(char[] str, int offset, int length) {
141
141
* Parses a big decimal string that has many digits.
Copy file name to clipboardExpand all lines: fastdoubleparser-dev/src/main/java/ch.randelshofer.fastdoubleparser/ch/randelshofer/fastdoubleparser/JavaBigDecimalFromCharSequence.java
+9-8Lines changed: 9 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -38,8 +38,7 @@ public JavaBigDecimalFromCharSequence() {
Copy file name to clipboardExpand all lines: fastdoubleparser-dev/src/test/java/ch.randelshofer.fastdoubleparser/ch/randelshofer/fastdoubleparser/AbstractBigDecimalParserTest.java
newNumberTestDataSupplier("significand with 40 zeroes in integer part", () -> newNumberTestData("significand with 40 zeroes in integer part", repeat("0", 40), BigDecimal::new)),
247
-
newNumberTestDataSupplier("significand with 40 zeroes in fraction part", () -> newNumberTestData("." + repeat("0", 40), BigDecimal::new)),
250
+
newNumberTestDataSupplier("significand with 40 zeroes in fraction part", () -> newNumberTestData("." + repeat('0', 40), BigDecimal::new)),
248
251
249
-
newNumberTestDataSupplier("significand with 10 leading zeros and 30 digits in integer part", () -> newNumberTestData("significand with 10 leading zeros and 30 digits in integer part", repeat("0", 10) + repeat("9", 30), BigDecimal::new)),
250
-
newNumberTestDataSupplier("significand with 10 leading zeros and 30 digits in fraction part", () -> newNumberTestData("." + repeat("0", 10) + repeat("9", 30), BigDecimal::new)),
251
-
newNumberTestDataSupplier("significand with 10 leading zeros and 30 digits in integer part and in fraction part", () -> newNumberTestData("significand with 10 leading zeros and 30 digits in integer part and in fraction part", repeat("0", 10) + repeat("9", 30) + "." + repeat("0", 10) + repeat("9", 30), BigDecimal::new)),
252
+
newNumberTestDataSupplier("significand with 10 leading zeros and 30 digits in integer part", () -> newNumberTestData("significand with 10 leading zeros and 30 digits in integer part", repeat('0', 10) + repeat('9', 30), BigDecimal::new)),
253
+
newNumberTestDataSupplier("significand with 10 leading zeros and 30 digits in fraction part", () -> newNumberTestData("." + repeat('0', 10) + repeat('9', 30), BigDecimal::new)),
254
+
newNumberTestDataSupplier("significand with 10 leading zeros and 30 digits in integer part and in fraction part", () -> newNumberTestData("significand with 10 leading zeros and 30 digits in integer part and in fraction part", repeat('0', 10) + repeat("9", 30) + "." + repeat("0", 10) + repeat("9", 30), BigDecimal::new)),
252
255
253
256
newNumberTestDataSupplier("significand with 40 digits in integer part and exponent", () -> newNumberTestData("-1234567890123456789012345678901234567890e887799", BigDecimal::new)),
Copy file name to clipboardExpand all lines: fastdoubleparser-dev/src/test/java/ch.randelshofer.fastdoubleparser/ch/randelshofer/fastdoubleparser/FftMultiplierTest.java
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -31,17 +31,17 @@ public List<DynamicTest> dynamicTestsMultiply() {
0 commit comments