[Top][All Lists]

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

Re: bug in eqv?

From: Marius Vollmer
Subject: Re: bug in eqv?
Date: 22 Mar 2006 01:52:40 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Kevin Ryde <address@hidden> writes:

> Aubrey Jaffer <address@hidden> writes:
> >
> > Because (= 0.0 -0.0) is #t, (eqv? 0.0 -0.0) must be #t.
> Ah dear, thanks.  Bit too much creativity with the nans and infs.

Hmm.  I think SRFI 77 (Preliminary Proposal for R6RS Arithmetic) would
require (eqv? 0.0 -0.0) => #f, since it says

    The eqv? procedure returns #f if obj1 and obj2 yield different
    results (in the sense of eqv?) when passed as arguments to any
    other procedure that can be defined as a finite composition of
    Scheme's standard arithmetic procedures.

and, for example, (eqv? (flatan2 -1.0 -0.0) (flatan2 1.0 -0.0)) => #f.
See also "Lucier's Proposal" in the SRFI 77 document.

I originally copied the behavior of PLT Scheme and I'd say it is OK to
follow SRFI 77 for the behavior of negative zero, infinities and NaNs
now that it exists.

(We get (integer? +inf.0) => #f wrong, then, and probably other

GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405

reply via email to

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