[r6rs-discuss] Re: [Formal] eq?/eqv? misbehave around NaNs
alan at alan-watson.org
Fri Nov 24 16:07:14 EST 2006
Marcin 'Qrczak' Kowalczyk wrote:
> Alan Watson <alan at alan-watson.org> writes:
>>One could imagine an implementation that implemented singles and
>>doubles, but promoted singles to doubles whenever they were used
>>in arithmetic (in the style of early C compilers) and implemented
>>real->single such that it gave a single result. I think on such an
>>implementation 1f0 and 1d0 would have to be eqv?.
> If they are distinguishable, they must not be eqv?.
> If they are indistinguishable, there is no point in providing
> different precisions.
There is. For use with non-standard extensions (e.g., an arithmetic
library specialized to singles).
This is a bit of a headache, because in this case they would not be
distinguishable by standard procedures, but might be distinguishable by
non-standard procedures. Defining eqv? in terms of its value (which does
not depend on the representation) rather than "distinguishly" (which
might) gets around this problem.
> Every value must be eqv? to itself.
Um, well we got here by wondering if +nan.0 was eqv? to itself, so I
take your statement to indicate your opinion rather than as something
that is an axiom.
More information about the r6rs-discuss