A lot of the discussion has diverted from my original point. I'm really
interested in putting NaN in the right part of the numeric tower. Just
like there is no basis to put NaN in as part of the real numbers, since
it doesn't fit the definition of a real number. It doesn't fit with the
complex numbers either.
So we have this numeric tower
Number -> Complex -> Real -> Rational -> Integers.
with each set of numbers on the right being a subset of the numbers on
the left.
My main argument is that NaN should belong in the Number set and not any
of the others. So the Number set would be the union of the Complex
numbers and NaN. If you look at the IEEE-754 number system, conceptually
you can think of it as the union of the Extended real numbers and NaN. I
don't believe that the IEEE-754 NaN requires that it be a real number
either. So this change would not have any effect on how IEEE-754 deals
with NaNs.
Dealing with +- infinity is a separate issue from the one I'm addressing.
Arthur
Aubrey Jaffer wrote:
> | Date: Thu, 21 Jun 2007 23:02:45 -0400
> | From: Arthur Smyles <atsmyles at rcn.com>
> |
> | Aubrey Jaffer wrote:
> | > | Date: Tue, 19 Jun 2007 00:47:13 -0400
> | > | From: Arthur Smyles <atsmyles at rcn.com>
> | > |
> | > | According to Section 2.4 Infinities and NaNs?
> | > |
> | > | "A NaN is regarded as a real (but not rational) number whose
> | > | value is so indeterminate that it might represent any real
> | > | number, including positive or negative infinity, and might
> | > | even be greater than positive infinity or less than negative
> | > | infinity."
> | > |
> | > | In formal comment 11, Aubrey Jaffer correctly stated that NaN
> | > | is not a real number. But, his conclusion that a NaN is a
> | > | complex number is also incorrect. The complex numbers
> | > | includes the set of all real and imaginary numbers. NaN is
> | > | neither real nor imaginary, therefore it cannot be a value in
> | > | the real or the imaginary part of a complex number, therefore
> | > | it cannot be complex. So the definition of a number is really
> | > | the set of all complex numbers and NaN.
> | >
> | > The argument naming conventions have `z' for complex arguments.
> | > If NaN is not complex, then the `z' convention must be changed to
> | > be: complex number or NaN.
> |
> | NaN describes specific situations in math that are undefined, like
> | 0/0. I think keeping the 'z' convention is fine for the purpose of
> | defining the class of numbers that the operation can apply to even
> | though in special cases you get an undefined result.
> |
> | > A similar situation exists for +inf.0, -inf.0 and real numbers.
> | > Do you consider +inf.0 and -inf.0 to be real numbers?
> |
> | Yes. See http://en.wikipedia.org/wiki/Extended_real_number_line
>
> Then we need to be more precise in our language.
>
> I believe you are suggesting that Scheme reals are a subset of the
> mathematical reals extended by +inf.0 and -inf.0, what
> http://en.wikipedia.org/wiki/Real_number calls the "affinely extended
> real number system".
>
> What, then, are Scheme complex numbers? As you pointed out,
> mathematical complex numbers are defined in terms of two mathematical
> real numbers. Hence, each complex is finite; thus -inf.0 and +inf.0
> are not mathematical complex numbers.
>
> But "DESCRIPTION OF THE LANGUAGE 1. Overview of Scheme" states:
>
> In Scheme, every integer is a rational number, every rational is a
> real, and every real is a complex number.
>
> So we have already run afoul of mathematics because the previous
> sentence mandates that (complex? +inf.0) be true; and each
> mathematical complex number is finite.
>
> One solution is to have Scheme complex numbers be a subset of the
> union of mathematical complex numbers with certain non-finite objects.
> In SRFI-70, which is the model for SCM's numerics, I chose to alloy
> -inf.0, +inf.0, and NaN into the set of Scheme complex numbers. The
> motivation for including NaN was so that Scheme complex numbers would
> be closed over the arithmetic operations. Good arguments can be made
> to exclude NaN; it is not an issue of importance to me.
>
> Notice that this model (with NaN or not) does not admit bastard
> infinities like +inf.0+5i, -inf.0+inf.0i, or -inf.0+nan.0i, which have
> no standing in mathematics.
>
> Operations which would naively produce such bastards should instead
> return the bottom element +nan.0. This results in "strict" arithmetic
> functions, if I understand Tom Lord correctly.
>
> The SRFI-70 model was developed from extensive experience with complex
> optical calculations (http://swiss.csail.mit.edu/~jaffer/FreeSnell),
> where infinities do sometimes occur.
>
Received on Sat Jun 23 2007 - 14:13:38 UTC