Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 81918 invoked from network); 9 May 2010 00:13:28 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 May 2010 00:13:28 -0000 Received: (qmail 36850 invoked by uid 500); 9 May 2010 00:13:27 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 36741 invoked by uid 500); 9 May 2010 00:13:26 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 36733 invoked by uid 99); 9 May 2010 00:13:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 May 2010 00:13:26 +0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS,STOX_REPLY_TYPE X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of billwbarker@verizon.net designates 206.46.173.1 as permitted sender) Received: from [206.46.173.1] (HELO vms173001pub.verizon.net) (206.46.173.1) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 May 2010 00:13:19 +0000 Received: from BillPC ([unknown] [71.160.100.218]) by vms173001.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0L24005UVLX4XP30@vms173001.mailsrvcs.net> for dev@commons.apache.org; Sat, 08 May 2010 19:12:42 -0500 (CDT) Message-id: <9A72E701CF934168805A2C19AF1916CA@BillPC> From: "Bill Barker" To: "Commons Developers List" References: <20100506120917.GI23030@dusk.harfang.homelinux.org> In-reply-to: <20100506120917.GI23030@dusk.harfang.homelinux.org> Subject: Re: [Math] NaN in "equals" Date: Sat, 08 May 2010 17:12:40 -0700 MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=iso-8859-1; reply-type=original Content-transfer-encoding: 7bit X-Priority: 3 X-MSMail-priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MIMEOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-Virus-Checked: Checked by ClamAV on apache.org -------------------------------------------------- From: "Gilles Sadowski" Sent: Thursday, May 06, 2010 5:09 AM To: Subject: [Math] NaN in "equals" > Hello. > > In the "MathUtils" class, "equals" methods consider that a NaN is equal to > a > NaN. It seems that the orthodox view is that such a comparison should > return > "false". > Is there a rationale behind the current behaviour (e.g. it is admittedly > more efficient to not call "Double.isNaN")? > Or can I make the changes in order to comply to IEEE? > Well, that is the convention in most of the library, so would be -1 to changing it only in MathUtils since it would then be inconsistent (e.g. ArrayRealVector.equals returns "true" if both vectors have a NaN in some (not necessarily the same) position. I would be -0.5 to changing it in a point release, since there may be users that are relying on the current behavior and point releases are supposed to be drop in replacements. I don't have strong feelings either way for the next major release. > > Best, > Gilles > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org