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

*To*: Alex Shinn <alexshinn@x>*Subject*: Re: [Scheme-reports] EQV? on numbers should be based on operational equivalence*From*: John Cowan <cowan@x>*Date*: Wed, 16 May 2012 20:44:22 -0400*Cc*: scheme-reports@x*In-reply-to*: <CAMMPzYMiA1CHg7mS31qiB=PAXMHsW1T8dZW5EZjJXPz9utj9Dw@mail.gmail.com>*References*: <87zk9jor6s.fsf@netris.org> <20120507213136.GA12719@mercury.ccil.org> <8762c7o8we.fsf@netris.org> <CAMMPzYMjv1jbMFAvzB7fQqbf69uCZg-0+Nwz-Nq+7Jrtd6QMUQ@mail.gmail.com> <87wr4nmo7f.fsf@netris.org> <CAMMPzYN4PYXfjQOO3dhGXqKA1NHjuQD4JwK3ozUkXdDCqDbSvQ@mail.gmail.com> <87sjfbmfop.fsf@netris.org> <CAMMPzYMiA1CHg7mS31qiB=PAXMHsW1T8dZW5EZjJXPz9utj9Dw@mail.gmail.com>

Alex Shinn scripsit: > We haven't generally made a distinction for a result being > "implementation-defined", simply saying "unspecified." Thus > with either the R3RS or current R7RS, for the specific question > > (= 0.0 -0.0) => ? > > the ? would be written "unspecified". That is, the semantics > are clearly defined by the standard but the effect varies per > implementation, so from a point of view of portability you > cannot reliably get a consistent result from this expression. It's more complex than that. There are three possibilities. 1) The implementation does not support -0.0 at all. If not, then the value of the expression `(eqv? 0.0 -0.0)` is always going to be #t. Both R5RS (sub silentio) and R6RS (explicitly) allow this. 2) The implementation supports -0.0 as numerically distinct from 0.0, but `(eqv? 0.0 -0.0)` returns #t. This is the natural interpretation of R5RS, because that standard defers to = when it is comparing inexact numbers, and everybody agrees that (= 0.0 -0.0) is #t. 3) The implementation supports -0.0 as numerically distinct from 0.0, but `(eqv? 0.0 -0.0)` returns #f. This is what R6RS requires. Therefore, R7RS requires (sub silentio) that if 0.0 and -0.0 are not mathematically distinct, then `eqv?` must return #t, but explicitly allows either #t or #f otherwise. -- John Cowan cowan@x http://ccil.org/~cowan The present impossibility of giving a scientific explanation is no proof that there is no scientific explanation. The unexplained is not to be identified with the unexplainable, and the strange and extraordinary nature of a fact is not a justification for attributing it to powers above nature. --The Catholic Encyclopedia, s.v. "telepathy" (1913) _______________________________________________ Scheme-reports mailing list Scheme-reports@x http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports

**References**:**[Scheme-reports] EQV? on numbers should be based on operational equivalence***From:*Mark H Weaver <mhw@x>

**Re: [Scheme-reports] EQV? on numbers should be based on operational equivalence***From:*John Cowan <cowan@x>

**Re: [Scheme-reports] EQV? on numbers should be based on operational equivalence***From:*Mark H Weaver <mhw@x>

**Re: [Scheme-reports] EQV? on numbers should be based on operational equivalence***From:*Alex Shinn <alexshinn@x>

**Re: [Scheme-reports] EQV? on numbers should be based on operational equivalence***From:*Mark H Weaver <mhw@x>

**Re: [Scheme-reports] EQV? on numbers should be based on operational equivalence***From:*Alex Shinn <alexshinn@x>

**Re: [Scheme-reports] EQV? on numbers should be based on operational equivalence***From:*Mark H Weaver <mhw@x>

**Re: [Scheme-reports] EQV? on numbers should be based on operational equivalence***From:*Alex Shinn <alexshinn@x>

- Prev by Date:
**[scheme-reports-wg1] Re: Trac Migration Complete** - Next by Date:
**[Scheme-reports] r7rs-draft-6: examples for when and unless** - Previous by thread:
**Re: [Scheme-reports] EQV? on numbers should be based on operational equivalence** - Next by thread:
**Re: [Scheme-reports] EQV? on numbers should be based on operational equivalence** - Index(es):