infinity, nan, etc redundant, also exact decimal arithmetic
Subject: infinity, nan, etc redundant, also exact decimal arithmetic
From: Richard Fateman
Date: Mon, 4 Sep 2006 20:53:27 -0700
Just another thought. We can use the ((rat) num denom) idiom for encoding
0/0, 0/1, 0/-1.
We do not need the symbols NaN, inf, minf, if they mean the same things.
(I'm not convinced this is a good idea, but in general, if you have more
than one way of saying the same data value, you are inviting bugs.
Another possibility is to just use the float objects, but since common lisp
systems seem to differ on their treatment, this would have to be done very
cautiously.
Also, I've written out some programs that do decimal arithmetic which is
exact and closed under + and *, and has exact output. That is,
1e100+1e-100 is 201 decimal digits long.
Mixing these objects with other numbers of type K converts these numbers to
K and continues. This is not hard to do.
Putting all this into maxima would require some attention in the region of
meval, numer, simp, mnump.
Sin, cos, tan, etc of decimal numbers could be done by converting them to
double-floats or bigfloats. (in which case a precision must be established).
RJF