[r6rs-discuss] [Formal] Unclear how equality predicates behave on NaN

From: John Cowan <cowan>
Date: Wed Sep 20 14:32:00 2006

Per Bothner scripsit:

> Agreed. I'd argue for "#t iff the bit patterns being compared are the
> same". Not necessarily that R6RS shoudl require this, but it might
> suggest/recommend this for implementations using IEEE floating-point.

So for the purposes of the standard, we are agreed that eqv? on a NaN
and another flonum may return either #t or #f? That is the status quo,
since eqv? may return #t where = would return #f.

> >The former method works, but the latter does not: given two Doubles
> >representing NaNs, Double.equals will return false.
>
> That is incorrect:
>
> $ bin/kawa
> #|kawa:1|# (define NaN java.lang.Double:NaN)
> #|kawa:2|# (NaN:equals NaN)
> #t

Quite right; there was a bug in my code.

-- 
John Cowan      cowan_at_ccil.org        http://www.ccil.org/~cowan
        Is it not written, "That which is written, is written"?
Received on Wed Sep 20 2006 - 14:31:45 UTC

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