[
https://issues.apache.org/jira/browse/LANG-1445?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary D. Gregory resolved LANG-1445.
-----------------------------------
Fix Version/s: 3.19.0
Resolution: Fixed
This has been fixed at some point in the past.
> NumberUtils.createNumber() incorrectly creates BigDecimal when a double type
> is specified
> -----------------------------------------------------------------------------------------
>
> Key: LANG-1445
> URL: https://issues.apache.org/jira/browse/LANG-1445
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.math.*
> Affects Versions: 3.8.1
> Reporter: Costa Theodosiou
> Priority: Major
> Fix For: 3.19.0
>
> Attachments:
> NumberUtils_createNumber()_incorrectly_creates_BigDecimal_when_a_double_type_is_specified.patch
>
>
> {{NumberUtils.createNumber(Double.valueOf(Double.MIN_VALUE).toString() +
> "D")}}
> and
> {{NumberUtils.createNumber(Double.valueOf(Double.MIN_VALUE).toString() +
> "F")}}
> are incorrectly creating BigDecimals.
> This is due to a bug:
> {{if (!(d.isInfinite() || d.floatValue() == 0.0D && !allZeros)) {}}
> which should be:
> {{if (!(d.isInfinite() || d.doubleValue() == 0.0D && !allZeros)) {}}
> A patch has been attached.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)