[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] Numerical example (real? -2.5+0.0i)
| Date: Sun, 2 Oct 2011 01:48:00 -0400
| From: John Cowan <cowan@x>
|
| Aubrey Jaffer scripsit:
|
| > | > That's reasonable: in fact, SCM doesn't support exact/exact
| > | > complex numbers either, which is perfectly fine. It just
| > | > means that no general complex number can be real.
| >
| > All real numbers are complex numbers. This derives from their
| > mathematical definitions.
|
| *General* complex number is a term defined in R5RS: it means
| non-real complex number, where "general" is used in the sense of
| "general case." Because it seems to confuse people, I have removed
| it from the draft R7RS.
Although "general complex number" occurs in R5RS, I can't find it
being defined by R5RS. The correct term is "non-real complex number".
"no general complex number can be real" then becomes
"no non-real complex number can be real", which is trivially true.
R5RS also uses the term "general real number"; and this is
problematical. The finite real values encoded in floating-point
representations are all rational, so there are no "non-rational real
number"s in implementations using fixed-point and floating-point
representations.
If "general real number" means "inexact real number", doesn't that
violate the principal: "Numerical tower independent of exactness"?
| > Shouldn't the predicates REAL? and COMPLEX? implement the
| > mathematical semantics for which they are named?
|
| ... There are two reasonable sets of semantics here, and by
| providing two sets of procedures we can support both. By adding an
| "exact-complex" feature, a program that depends on exact complex
| numbers can rely on being run only on an implementation that
| supports them.
The terms integer, rational, real, and complex are too few to
adequately describe all the possible numeric Scheme types. Rather
than misuse basic mathematical terms, coin new names for the numeric
types which don't match the mathematical types.
_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports