emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Q on NaN


From: Drew Adams
Subject: RE: Q on NaN
Date: Fri, 24 Jun 2005 15:54:38 -0700

        (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 via email to

[Prev in Thread] Current Thread [Next in Thread]