| 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 - 13:19:11 UTC