We're updating the issue view to help you get more done. 

DecimalFormat parsing throws exception when exponent is greater than 1 billion

Description

ICU 58 had returned Double.POSITIVE_INFINITY for all numbers with exponent greater than 1000. This restriction was lifted by #13038. However, GoogleIssue:38194540 found that due to another restriction in com.ibm.icu.math.BigDecimal, an exception is still being thrown for exponents greater than 1,000,000,000.

Test case that fails:

1 2 3 4 5 6 @Test public void testParseVeryVeryLargeExponent() { DecimalFormat df = new DecimalFormat(); ParsePosition ppos = new ParsePosition(0); df.parse("1.2E+1234567890", ppos); }

Without diving into the depths of com.ibm.icu.math.BigDecimal, which is being deprecated by #13184, the best way to patch this regression is probably to just return Double.POSITIVE_INFINITY (or NEGATIVE_INFINITY, etc) when the exponent is too large.

Environment

Status

Assignee

Shane Carr

Reporter

Shane Carr

Labels

tracCc

andy,jkadams@1d5920f4b44b27a8

tracCreated

May 20, 2017, 2:11 AM

tracOwner

shane

tracProject

ICU4J

tracReporter

shane

tracResolution

fixed

tracReviewer

andy

tracStatus

closed

Components

Fix versions

Priority

major