Am Di., 25. Aug. 2020 um 21:08 Uhr schrieb John Cowan <co...@ccil.org
> On Tue, Aug 25, 2020 at 11:47 AM Marc Nieper-Wißkirchen <marc....@gmail.com
>> > > (Quaternions are certainly more useful than the exact complex numbers
>> > > that have been voted into R7RS-large.)
> Well, they are interesting enough to mathematicians to have a name, the Gaussian rationals, and they are a field, even if (like the ordinary rationals) not a particularly "useful" field. To quote math.stackexchange:
The Gaussian rationals are interesting because they form a number
field. But so are the other number fields. (If you have some time try
to understand the relative elementary proof of Fermat's Last Theorem
for p = 3 that uses the Eisenstein numbers.) So it's not really the
exact complex numbers we would like to have but exact algebraic
numbers. Only by chance, the exact complex numbers can be used to
model a single number field.
>> For the purposes of algebra, ℚ is not a very nice field to work with: for example, many (most?) polynomials don't even have a root, let alone factor completely, and dealing properly with this deficiency is the subject of the frontiers of mathematical research!
The latter is true. But I would replace "not a very nice field" by "a
much more interesting field". In the same way, the integers are a more
interesting ring than the rationals: In the integers, the concept of
divisibility is a rich one; in the rationals, it isn't.
>> Similarly, for the purposes of analysis, ℚ is not a very nice ordered set; for example, they form a totally disconnected space, making them nearly useless for capturing even basic familiar geometric notions such as continuity.
There's more than analysis. But even for analysis, Q is more
fundamental than R. The reals are the completion of Q with respect to
the usual absolute value; but there are other completions of Q leading
to the p-adic fields and p-adic analysis.
(These do not fit into the linear Scheme numeric tower, though.)
>> (1) The optional extension of the numeric tower to include the
>> quaternions as a superset of the complex numbers.
> But where does one stop? The octonions, for example, are connected with the exceptional Lie groups and have applications in string theory. And who knows, perhaps the sedecimonions (?) will find an application one day. It seems like user extensibility of the tower is going to be a must if this is going to go anywhere.
The quaternions still form a field (although a skew field) and linear
algebra is still possible. The octonions, on the other hand, are no
longer associative and fit the concept of a number much less.
Quaternions are very useful in applications driven by computers like
3D graphics and robotics. On the other hand, the applications of
octonions seem more theoretical and unless there is an application
where one has to do actual calculations within sight, I don't see a
reason to add them.
When we have basic linear algebra routines for matrices of Scheme
numbers, allowing quaternions seamlessly would come in very handy and
that's one reason why adding them can be useful.
> On Tue, Aug 25, 2020 at 2:11 PM Linas Vepstas <linasv...@gmail.com
>>> For that I have no clue whatsoever, as the whole numeric-tower thing in scheme is utterly opaque to me.
> It's pretty straightforward and "mathematical": the integers are a subset of the rationals, which are a subset of the reals, which are a subset of the complex numbers, which are a subset of (typically the same as) the numbers. By convention, +inf.0, -inf.0, and +nan.0 are real but not rational.
> Orthogonal to this is the notion of exactness. Broadly speaking, a number is inexact if it is specified as an inexact literal or if it is derived from other inexact numbers. There are exceptions: (* 1.0 0) and (sqrt 4) may be either exact or inexact. Note that all three arguments are integers in Scheme.
> None of this has anything to do with particular representations, which is how most programming languages approach numbers. A common approach to a full Scheme numeric tower is to have six representations:
> o fixnums (exact integers of small magnitude)
> o bignums (other exact integers)
> o flonums (inexact approximations to the reals)
> o ratnums (pairs of bignums or fixnums representing numerator and denominator)
> o compnums (pairs of flonums representing real and imaginary parts)
> o rectnums (pairs of arbitrary real numbers).
Thanks for this table.
As one can see, unless the compiler can prove that a number is of a
certain type, runtime type dispatch is unavoidable (unless the
implementation just has one complex representation, making most
integer and real operations rather slow). Adding one more
representation, quatnum, being a pair of two complex numbers, wouldn't
make the type dispatch noticeably slower. (Especially the common fast
path, the integer path, should stay the same.) But Per can probably
say a bit more as Kawa actually implements this.