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

Sebb commented on LANG-693:
---------------------------

Examples of valid numbers that would trigger an upscale:

Float.MAX_VALUE is 3.4028235e+38 - i.e. 8 digits; that would convert to Double
Double.MAX_VALUE is 1.7976931348623157e+308 - i.e. 17 digits; would convert to 
BigDecimal

In theory one could do extra work to handle the boundary cases.
I've not looked at what is involved.
                
> 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
>             Fix For: 3.x
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to