You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by NickManley <gi...@git.apache.org> on 2016/05/24 09:29:10 UTC

[GitHub] commons-lang pull request: LANG-1018: Fix precision loss on Number...

GitHub user NickManley opened a pull request:

    https://github.com/apache/commons-lang/pull/156

    LANG-1018: Fix precision loss on NumberUtils.createNumber(String)

    **Warning: This patch will break backwards compatibility.**
    
    This patch is designed to fix the loss of precision when using NumberUtils.createNumber(String). However, the fix is not 100% backwards compatible with the currently released commons-lang 3.4. To fix the loss of precision, values that were previously returning Floats are now returning Doubles. Some explicit casts may break as a result.
    
    ```java
    // Works in 3.4, but causes ClassCastException in patch.
    Float f = (Float) NumberUtils.createNumber("-160952.54");
    System.out.println(f); // prints "-160952.55"
    
    // Works with patch.
    Double d = (Double) NumberUtils.createNumber("-160952.54");
    System.out.println(d); // prints "-160952.54"
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/NickManley/commons-lang LANG-1018

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/156.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #156
    
----
commit b77db22614da6f0c674b57cd0086048b58b30135
Author: Nick Manley <ni...@outlook.com>
Date:   2016-05-24T09:10:29Z

    LANG-1018: Fix precision loss on NumberUtils.createNumber(String)

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang pull request #156: LANG-1018: Fix precision loss on NumberUtils...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/commons-lang/pull/156


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang issue #156: LANG-1018: Fix precision loss on NumberUtils.create...

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the issue:

    https://github.com/apache/commons-lang/pull/156
  
    @NickManley Not sure if you checking jira, so I thought I let you know there is some feedback on your pull request there: https://issues.apache.org/jira/browse/LANG-1018?focusedCommentId=15316755&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15316755



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang issue #156: LANG-1018: Fix precision loss on NumberUtils.create...

Posted by PascalSchumacher <gi...@git.apache.org>.
Github user PascalSchumacher commented on the issue:

    https://github.com/apache/commons-lang/pull/156
  
    Thanks! :+1: 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] commons-lang issue #156: LANG-1018: Fix precision loss on NumberUtils.create...

Posted by coveralls <gi...@git.apache.org>.
Github user coveralls commented on the issue:

    https://github.com/apache/commons-lang/pull/156
  
    
    [![Coverage Status](https://coveralls.io/builds/6540761/badge)](https://coveralls.io/builds/6540761)
    
    Coverage increased (+0.02%) to 93.466% when pulling **07354e2df2189ba5a99a17c0a1583fd96723f685 on NickManley:LANG-1018** into **f08c4f6ae9f8190bcaf0a8bbb82530233bf51bf9 on apache:master**.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---