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

From: Marcin 'Qrczak' Kowalczyk <qrczak>
Date: Tue Nov 28 15:30:42 2006

Alan Watson <alan_at_alan-watson.org> writes:

> 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)))

Yes.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak_at_knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/
Received on Tue Nov 28 2006 - 15:29:11 UTC

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