[R6RS] Preparation for next meeting

dyb at cs.indiana.edu dyb
Thu May 19 00:49:22 EDT 2005


Will,

As you're considering both the numeric stuff and eqv? / equal?, please
think about what the following (and similar) should evaluate to.

   (eqv? 0.0 -0.0)
   (eqv? 1.0-0.0i 1.0+0.0i)
   (eqv? 1.0 1.0+0.0i)
   (eqv? 1.0 1.0-0.0i)

R5RS would have them each evaluate to #t, but the values being compared
are not "operationally equivalent" with IEEE arithmetic, since +0.0 and
-0.0 are, by definition, very small positive and negative quantities,
respectively.  This difference can be exposed with reciprocal, for
example:

   (/ 0.0) ;=> +inf.0
   (/ -0.0) ;=> -inf.0

   (/ (imag-part (- 1.0))) ;=> +inf.0
   (/ (imag-part (- 1.0+0.0i))) ;=> -inf.0

So perhaps the eqv? calls above should evaluate to #f.

The same questions apply to equal?.

Part of the issue with the third and fourth eqv? calls above is what we
consider the imaginary part of an inexact real R to be.  Is it exact 0?
Is it inexact 0.0, i.e., +0.0?  Perhaps it depends on R.  Maybe
(imag-part R) is +0.0 for positive R, -0.0 for negative R, and NaN
for NaN.

Kent


More information about the R6RS mailing list