[r6rs-discuss] Re: [Formal] eq?/eqv? misbehave around NaNs
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.
Regards,
Alan
Received on Fri Nov 24 2006 - 16:07:14 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:00 UTC