unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: Q on NaN
Date: Fri, 24 Jun 2005 15:54:38 -0700	[thread overview]
Message-ID: <DNEMKBNJBGPAOPIJOOICGELFCJAA.drew.adams@oracle.com> (raw)
In-Reply-To: <200506242231.j5OMVNX11039@raven.dms.auburn.edu>

        (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:
       ...
          /* If d is a NaN, then d != d. Two NaNs should be `equal' even
             though they are not =. */

Thanks for confirming. I guess I could have searched the code myself - mea
culpa.

Given the equivalence, I suggest that the clearest idiom is (equal foo
0.0e+NaN).

We should mention this use of `equal' with NaN in the doc: anything `equal'
to a NaN is NaN (all NaN are `equal').

We should also mention the trick (and (numberp foo) (/= foo foo)) ==> foo is
NaN.

We might still want to add a standard predicate for testing NaN-ness:
`nanp'. (`not-a-number-p' would be confusing.)

  reply	other threads:[~2005-06-24 22:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-24 19:06 Q on NaN Drew Adams
2005-06-24 19:33 ` Drew Adams
2005-06-24 19:46   ` Drew Adams
2005-06-24 21:01   ` Eli Zaretskii
2005-06-24 20:26     ` Drew Adams
2005-06-24 20:56       ` Gaëtan LEURENT
2005-06-24 20:59       ` Luc Teirlinck
2005-06-24 22:03       ` Eli Zaretskii
2005-06-24 21:49         ` Drew Adams
2005-06-24 22:31           ` Luc Teirlinck
2005-06-24 22:54             ` Drew Adams [this message]
2005-06-25 13:35       ` Richard M. Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DNEMKBNJBGPAOPIJOOICGELFCJAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).