[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] multiple NaN values

Aubrey Jaffer scripsit:

> We should not confuse IEEE-754 with Real Analysis.

Indeed.  However, both R7RS and R6RS play by IEEE-754 rules: that is,
NaN can either be no number at all, or it can be so inexact as to be any
number at all.  They also treat NaNs as real but not rational.  In R7RS
but not R6RS, rectangular complex numbers return #t to `nan?` if either
the real or the imaginary part is NaN.

> (eq? +nan.0 +nan.0) in SCM, so (= +nan.0 +nan.0).  Either that
> behavior or signaling an error (because +nan.0 is not a complex
> number) would be acceptable for SCM.  Does R7RS permit an
> implementation to behave in one of these ways?

No.  NaN is never = to any number, including NaN.

> The argument prototypes for <, <=, >, and >= are x1, x2, ..., meaning
> that they are restricted to real numbers.  1+3i and NaN are not real
> numbers, so my reading is that an implementation is allowed to signal
> an error for these arguments.

Certainly for complex numbers.  However, NaN is real and the result of a
comparison involving NaN is #f.

With techies, I've generally found              John Cowan
If your arguments lose the first round          http://www.ccil.org/~cowan
    Make it rhyme, make it scan                 cowan@x
    Then you generally can
Make the same stupid point seem profound!           --Jonathan Robie

Scheme-reports mailing list