You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thundre (Updated) (JIRA)" <ji...@apache.org> on 2012/02/12 17:12:59 UTC

[jira] [Updated] (MATH-744) BigFraction.doubleValue() returns Double.NaN for large numerators or denominators

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

Thundre updated MATH-744:
-------------------------

    Attachment: site.patch

Patch file for the fraction package.
                
> BigFraction.doubleValue() returns Double.NaN for large numerators or denominators
> ---------------------------------------------------------------------------------
>
>                 Key: MATH-744
>                 URL: https://issues.apache.org/jira/browse/MATH-744
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Thundre
>         Attachments: site.patch
>
>
> The current implementation of doubleValue() divides numerator.doubleValue() / denominator.doubleValue().  BigInteger.doubleValue() fails for any number greater than Double.MAX_VALUE.  So if the user has 308-digit numerator or denominator, the resulting quotient fails, even in cases where the result would be well inside Double's range.
> I have a patch to fix it, if I can figure out how to attach it here I will.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira