-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
This relates to FasterXML/jackson-databind#4694 (comment)
A Jackson user hit an issue with the test case below. The JavaBigDecimalParser.parseBigDecimal call works for the String input but with the char array input, the wrong result is generated. The wrong value is -1.1000E-648.
@Test
void issueDatabind4694() {
final String str = "-11000.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
final BigDecimal expected = new BigDecimal(str);
assertEquals(expected, JavaBigDecimalParser.parseBigDecimal(str));
final char[] arr = str.toCharArray();
assertEquals(expected, JavaBigDecimalParser.parseBigDecimal(arr, 0, arr.length));
}
Metadata
Metadata
Assignees
Labels
No labels