Re: [Scheme-reports] ballot question #229: EQV? and NaN
Aubrey Jaffer 29 Sep 2011 18:56 UTC
| Date: Wed, 28 Sep 2011 21:12:06 -0400 (EDT)
| From: will@ccs.neu.edu
|
| ...
|
| I suspect that the
| person(s) who ran the tests was unaware that the behavior of
| NaNs is system-specific: It depends on the hardware and the
| numerical libraries as well as upon the parts of the system
| that are under the control of an implementor of Scheme.
There is only one NaN in SCM. So the behavior of NaNs in SCM is
independent of hardware and libraries:
(eqv? +nan.0 (/ 0.0 0.0)) ==> #t
| What's more, the result depends on the particular NaNs that
| are involved in the test. Here's an example from Larceny
| running on a Macintosh:
|
| > (begin (define nan0 +nan.0)
| (define nan1 (/ 0.0 0.0))
| (define nan2 (- +inf.0 +inf.0)))
|
| > (eqv? nan0 nan0)
| #t
|
| > (eqv? nan1 nan1)
| #t
|
| > (eqv? nan2 nan2)
| #t
|
| > (eqv? nan0 nan1)
| #f
|
| > (eqv? nan0 nan2)
| #f
|
| > (eqv? nan1 nan2)
| #t
All of these return #t in SCM.
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports