[r6rs-discuss] [Formal] Formal Comment: NaN should be considered a number, not a real

From: John Cowan <cowan>
Date: Thu, 21 Jun 2007 23:37:02 -0400

Arthur Smyles scripsit:

> NaN describes specific situations in math that are undefined, like
> 0/0.

That's what is so excellent about the R6RS definition. 0/0 is undefined
because any number times 0 is 0, and so a NaN is a maximally inexact
number: it could be any real number or even +inf or -inf. The same
story with (- +inf +inf) and its algebraic equivalents, which is the other
main way to generate a NaN.

As long as complex numbers are primarily viewed as rectangular and
potentially of mixed exactness, it's quite plausible to allow NaN as
either componenent. Mathematically, you could allow NaN to be
a non-real complex number, but pragmatically that turns out to be
undesirable, given the behavior of floating-point hardware.
Doing so requires every floating point operation on real and imaginary
parts to include an extra check.

-- 
John Cowan
        cowan at ccil.org
                I am a member of a civilization. --David Brin
Received on Thu Jun 21 2007 - 23:37:02 UTC

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