[r6rs-discuss] Re: [Formal] eq?/eqv? misbehave around NaNs

From: William D Clinger <will>
Date: Fri Nov 24 15:16:56 2006

I am posting this as an individual member of the Scheme
community. I am not speaking for the R6RS editors, and
this message should not be confused with the editors'
eventual formal response.

Alan Watson wrote:
> According to page 35 of the draft, eqv? returns #t if:
>
> Obj1 and obj2 are both inexact numbers, are numerically equal (see =,
> section 9.10), and yield the same 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.

Per Bothner wrote:
> The wording is wrong. It is either incomplete or non-computable.

I believe the wording is as intended. It is incomplete
in the sense that it states only the conditions under
which the eqv? procedure is required to return #t when
applied to inexact numbers; a separate item states the
conditions under which the eqv? procedure is required
to return #f when applied to inexact numbers.

The specification is indeed non-computable. For an
axiomatic specification such as the draft R6RS, that
is not an issue. What does matter is that there be
computable implementations of the axioms. There are.

Indeed, the obvious implementation in which eqv?
returns false when given inexact numbers of differing
precisions would satisfy the requirements of the draft
R6RS, unless the implementation is doing something
very strange.

> ....I would not consider two different
> IEEE precisions as being the same value.

I doubt whether two inexact numbers of different
precisions would yield the same 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. If they do not always
yield the same results, then the paragraph quoted by
Alan Watson does not require them to be eqv?.

If they do always yield the same results, then they
have the same precision for all arithmetic purposes.

Will
Received on Fri Nov 24 2006 - 15:16:49 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:00 UTC