[Top][All Lists]
[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.)
- Q on NaN, Drew Adams, 2005/06/24
- RE: Q on NaN, Drew Adams, 2005/06/24
- Re: Q on NaN, Eli Zaretskii, 2005/06/24
- RE: Q on NaN, Drew Adams, 2005/06/24
- Re: Q on NaN, Luc Teirlinck, 2005/06/24
- Re: Q on NaN, Gaƫtan LEURENT, 2005/06/24
- Re: Q on NaN, Eli Zaretskii, 2005/06/24
- RE: Q on NaN, Drew Adams, 2005/06/24
- Re: Q on NaN, Luc Teirlinck, 2005/06/24
- RE: Q on NaN,
Drew Adams <=
- Re: Q on NaN, Richard M. Stallman, 2005/06/25
RE: Q on NaN, Drew Adams, 2005/06/24