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

From: Alan Watson <alan>
Date: Tue Nov 28 13:40:49 2006

Marcin 'Qrczak' Kowalczyk wrote:
> Almost. The other special case is (= 0.0 -0.0) but (not (eqv? 0.0 -0.0)).

Does this work, assuming x and y are both inexact numbers and we have
IEEE arithmetic?

(cond
   ((nan? x) (nan? y))
   ((and (zero? x) (zero? y)) (= (/ 1.0 x) (/ 1.0 y)))
   (else (= x y)))

Regards,

Alan
Received on Tue Nov 28 2006 - 13:40:19 UTC

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