commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (LANG-1087) NumberUtils#createNumber() returns positive BigDecimal when negative Float is expected
Date Sun, 01 Mar 2015 16:49:04 GMT

     [ https://issues.apache.org/jira/browse/LANG-1087?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Benedikt Ritter resolved LANG-1087.
-----------------------------------
       Resolution: Fixed
    Fix Version/s: 3.4

{code}
$ svn ci -m "LANG-1087: NumberUtils#createNumber() returns positive BigDecimal when negative
Float is expected. Thanks to Renat Zhilkibaev."
Sending        src/changes/changes.xml
Sending        src/main/java/org/apache/commons/lang3/math/NumberUtils.java
Sending        src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
Transmitting file data ...
Committed revision 1663129.
{code}

Thank you!

> NumberUtils#createNumber() returns positive BigDecimal when negative Float is expected
> --------------------------------------------------------------------------------------
>
>                 Key: LANG-1087
>                 URL: https://issues.apache.org/jira/browse/LANG-1087
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.math.*
>    Affects Versions: 3.x
>            Reporter: Renat Zhilkibaev
>            Assignee: Benedikt Ritter
>             Fix For: 3.4
>
>         Attachments: lang-1087-patch1.diff
>
>
> {{NumberUtils.createNumber("-0.0")}} returns {{BigDecimal}} with 0 signum.
> Caused by the implementation not checking for sign when extracting mantissa from the
input string.
> Expected is that negative {{Float}} is returned.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message