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

Re: [Scheme-reports] ballot question #229: EQV? and NaN



 | Date: Wed, 28 Sep 2011 21:12:06 -0400 (EDT)
 | From: will@x
 | 
 | ...
 | 
 | 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@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports