From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: Q on NaN Date: Fri, 24 Jun 2005 17:31:23 -0500 (CDT) Message-ID: <200506242231.j5OMVNX11039@raven.dms.auburn.edu> References: NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1119654139 10405 80.91.229.2 (24 Jun 2005 23:02:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 24 Jun 2005 23:02:19 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 25 01:02:18 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DlxBZ-0000e8-3B for ged-emacs-devel@m.gmane.org; Sat, 25 Jun 2005 01:02:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DlxIg-0007yV-4g for ged-emacs-devel@m.gmane.org; Fri, 24 Jun 2005 19:09:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dlx7q-000595-Tj for emacs-devel@gnu.org; Fri, 24 Jun 2005 18:58:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dlx7m-00055T-St for emacs-devel@gnu.org; Fri, 24 Jun 2005 18:58:16 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dlx7l-0004eM-Nc for emacs-devel@gnu.org; Fri, 24 Jun 2005 18:58:14 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dlwmy-0001XS-2O for emacs-devel@gnu.org; Fri, 24 Jun 2005 18:36:44 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id j5OMWxCK006419; Fri, 24 Jun 2005 17:32:59 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j5OMVNX11039; Fri, 24 Jun 2005 17:31:23 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: drew.adams@oracle.com In-reply-to: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:39467 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:39467 Drew Adams wrote: Does anyone know that these are not equivalent: (equal 0.0e+NaN) <=?=> (and (numberp x) (/= x x)) That is, are there any objects equal to 0.0e+NaN that are not NaN? They are equivalent. internal_equal contains: case Lisp_Float: { double d1, d2; d1 = extract_float (o1); d2 = extract_float (o2); /* If d is a NaN, then d != d. Two NaNs should be `equal' even though they are not =. */ return d1 == d2 || (d1 != d1 && d2 != d2); } Yes, for testing a numberp to see if it is not NaN. However, I am testing an arbitrary object. For that, (and (numberp x) (/= x x)) works and (equal x 0.0e+Nan) works. Yes. Sincerely, Luc.