Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E20F49888 for ; Sun, 12 Feb 2012 21:17:23 +0000 (UTC) Received: (qmail 365 invoked by uid 500); 12 Feb 2012 21:17:23 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 143 invoked by uid 500); 12 Feb 2012 21:17:22 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 135 invoked by uid 99); 12 Feb 2012 21:17:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Feb 2012 21:17:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Feb 2012 21:17:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 62A501B22E0 for ; Sun, 12 Feb 2012 21:16:59 +0000 (UTC) Date: Sun, 12 Feb 2012 21:16:59 +0000 (UTC) From: "Thundre (Commented) (JIRA)" To: issues@commons.apache.org Message-ID: <2084798942.29930.1329081419405.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1553067498.29624.1329063179521.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (MATH-744) BigFraction.doubleValue() returns Double.NaN for large numerators or denominators MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MATH-744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13206520#comment-13206520 ] Thundre commented on MATH-744: ------------------------------ I noticed that floatValue() has the same bug. Stand by for more patches. > 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, test.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