[r6rs-discuss] Re: [Formal] eq?/eqv? misbehave around NaNs
Per Bothner
per at bothner.com
Fri Nov 24 11:55:20 EST 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/
More information about the r6rs-discuss
mailing list