Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 77990 invoked from network); 10 May 2010 10:15:13 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 May 2010 10:15:13 -0000 Received: (qmail 13567 invoked by uid 500); 10 May 2010 10:15:13 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 13315 invoked by uid 500); 10 May 2010 10:15:11 -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 13305 invoked by uid 99); 10 May 2010 10:15:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 May 2010 10:15:10 +0000 X-ASF-Spam-Status: No, hits=-1408.2 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 May 2010 10:15:09 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o4AAEmOF019860 for ; Mon, 10 May 2010 10:14:49 GMT Message-ID: <29048371.62791273486488951.JavaMail.jira@thor> Date: Mon, 10 May 2010 06:14:48 -0400 (EDT) From: "Gilles (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (MATH-370) NaN in "equals" methods In-Reply-To: <28688760.29921273232028239.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MATH-370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12865720#action_12865720 ] Gilles commented on MATH-370: ----------------------------- Well, the first impression I got from looking at those methods in "MathUtils" was indeed that they provide the "right" way to compare primitive doubles. Now, the right way for most users dealing with numerical codes should arguably be IEEE754-compliant. So, unless we can explain that the way CM handles NaN is somehow more useful than what the IEEE standard defines, CM should at least provide "equals" utility methods that stick to the standard. I understand the usefulness of the current implementation in the examples which you gave, but as a matter of principle this usage is second in priority (from a user perspective): it is mainly internal to CM. Maybe, we should create a "util.internal" package where (CM) developer-utilities methods would live, whereas "util" would contain the functions which users are most likely looking for. I think that it would be clearer (e.g. it would avoid dealing with long names such as "equalsIncludingNaN"). What do you think? > NaN in "equals" methods > ----------------------- > > Key: MATH-370 > URL: https://issues.apache.org/jira/browse/MATH-370 > Project: Commons Math > Issue Type: Bug > Reporter: Gilles > Priority: Minor > > In "MathUtils", some "equals" methods will return true if both argument are NaN. > Unless I'm mistaken, this contradicts the IEEE standard. > If nobody objects, I'm going to make the changes. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.