commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Rego (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-693) Method createNumber from NumberUtils doesn't work for floating point numbers other than Float
Date Tue, 26 Apr 2011 07:38:03 GMT

    [ https://issues.apache.org/jira/browse/LANG-693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025113#comment-13025113
] 

Carlos Rego commented on LANG-693:
----------------------------------

We've have tested it in a JUnit with the following string: "0.9090909090909091", that debugging
it returns a float with the value 0.90909094, which clearly is wrong. That's why we thought
the approach for the conversion is wrong.
Did you tried to debug it just to be sure that the execution flow is going as you expect?

> Method createNumber from NumberUtils doesn't work for floating point numbers other than
Float
> ---------------------------------------------------------------------------------------------
>
>                 Key: LANG-693
>                 URL: https://issues.apache.org/jira/browse/LANG-693
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.math.*
>    Affects Versions: 2.6
>            Reporter: Carlos Rego
>            Priority: Minor
>
> Method createNumber from NumberUtils is trying to parse a string with a floating point
number always first as a Float, that will cause that if we send a string with a number that
will need a Double or even a BigDecimal the number will be truncate to accommodate into the
Float without an exception to be thrown, so in fact we will no be returning ever neither a
Double nor a BigDecimal.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message