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

From: Per Bothner <per>
Date: Fri Nov 24 11:54:26 2006

Alan Watson wrote:
> Per Bothner wrote:
>> If inexacts are boxed, then the implementor can easily implement
>> eqv? on inexacts by comparing their bits.
>
> I was coming round to this point of view, but then I realized that you
> cannot trivially implement eqv? using a bitwise comparison if there are
> inexacts with different representations, say singles and doubles. In
> such implementations,

eqv? between a single and a double is #f. They're not the same value.
End of story.

> However, my point is that eqv? in
> this implementation no longer means "has the same bit representation".

"same bit representation" *assuming* they're the same type;
#f if they're different types.

Just like a list and a vector aren't equal?.

(We're talking about eqv? but of course the discussion has implications
for equal? - two numbers are eqv? iff they are equal?)
-- 
	--Per Bothner
per_at_bothner.com   http://per.bothner.com/
Received on Fri Nov 24 2006 - 11:55:20 UTC

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