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

From: Per Bothner <per>
Date: Thu Nov 23 15:49:42 2006

Jens Axel S?gaard wrote:
> Marcin 'Qrczak' Kowalczyk skrev:
>> John Cowan <cowan_at_ccil.org> writes:
>>
>>>> Is there any scenario where you'd want anything other than:
>>>>
>>>> (eqv? +nan.0 +nan.0) => #t
>>> Eqv? on unboxed floats can be implemented by bitwise comparison
>>> rather than floating-point equality.
>>
>> And this is why it should be #t.
>
> There is more than one bit-pattern for +nan.0.

No. The bit-pattern for +nan.0 is not fully specified by IEEE,
and hence should not be specified by R6RS, but for any given
implementation the literal +nan.0 can only evaluate to a
single bit-pattern. This is not inconsistent with allowing
an implementation to interpret multiple bit-patterns as NaN.
However, +nan.0 is the canonical/default NaN, and it cannot
randomly change value during execution.
-- 
	--Per Bothner
per_at_bothner.com   http://per.bothner.com/
Received on Thu Nov 23 2006 - 15:51:15 UTC

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