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 71EF18E8C for ; Fri, 9 Sep 2011 13:44:34 +0000 (UTC) Received: (qmail 83148 invoked by uid 500); 9 Sep 2011 13:44:33 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 82967 invoked by uid 500); 9 Sep 2011 13:44:32 -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 82945 invoked by uid 99); 9 Sep 2011 13:44:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Sep 2011 13:44:32 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,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; Fri, 09 Sep 2011 13:44:30 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id ED9958A0F3 for ; Fri, 9 Sep 2011 13:44:08 +0000 (UTC) Date: Fri, 9 Sep 2011 13:44:08 +0000 (UTC) From: "Yannick TANGUY (JIRA)" To: issues@commons.apache.org Message-ID: <779163249.8004.1315575848969.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1549386014.19677.1315301411656.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (MATH-658) Dead code in FastMath.pow(double, double) and some improvement in test coverage 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-658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101209#comment-13101209 ] Yannick TANGUY commented on MATH-658: ------------------------------------- Ok Sebb, I'll put messages in the assertion for future patches. > Dead code in FastMath.pow(double, double) and some improvement in test coverage > ------------------------------------------------------------------------------- > > Key: MATH-658 > URL: https://issues.apache.org/jira/browse/MATH-658 > Project: Commons Math > Issue Type: Improvement > Reporter: Yannick TANGUY > Priority: Minor > Fix For: 3.0 > > Attachments: FastMath.java.diff, FastMathTest.java.diff > > > This issue concerns the FastMath class and its test class. > (1) In the double pow(double, double) function, there are 2 identical "if" blocks. The second one can be suppressed. > if (y < 0 && y == yi && (yi & 1) == 1) { > return Double.NEGATIVE_INFINITY; > } > // this block is never used -> to be suppressed > if (y < 0 && y == yi && (yi & 1) == 1) { > return -0.0; > } > if (y > 0 && y == yi && (yi & 1) == 1) { > return -0.0; > } > (2) To obtain better code coverage, we added some tests case in FastMathTest.java (see attached file) > - Added test for log1p > - Added tests in testPowSpecialCases() > - Added tests for a 100% coverage of acos(). > - Added tests for a 100% coverage of asin(). -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira