[Maxima] Rational Numbers, was Re: [Maxima-commits] CVS: maxima/src gamma.lisp, 1.44, 1.45.
raymond.toy at stericsson.com
Wed Nov 18 10:26:27 CST 2009
Richard Fateman wrote:
> inserting quoted headers with "simp" literally may be a mistake.
> Ideally there should be only one copy of the list (XXX simp) in the
> whole system, and that copy should be found by (get 'XXX 'msimpind)
> for example, (get 'mplus 'msimpind).
> and the CAR of every mplus should point to it.
I suspect the current code has been very careless about this. I know I
have been, because I didn't know that.
> In the case of a rational number, there is no msimpind. I don't know why.
> On the other hand, I just checked with the commercial Macsyma, and they
> seem to have flushed the whole msimpind idea.
Is there a fundamental reason that there should only be one (XXX simp)?
Was this just to save memory? We've probably inadvertently flushed the
msimpind idea from Maxima anyway. But I do see that eqtest has a check
> My suggestion (I have occasionally implemented this in some
> experiments) is to use common lisp rational numbers for maxima rational
> It is easy to do with a few patches, but the question remains as to
> whether all places have been fixed. Note that (div 1 2) could be easily
> fixed to return the common lisp rational number 1/2 . finding all
> occurrences of '((rat simp) 1 2) would be more difficult.
I think using Lisp rational numbers should be done. Perhaps we can do
this after the next release? This gives us several months to find and
fix all of these literal occurrences of ((rat simp) 1 2) and friends. A
simple grep would probably catch most of them.
More information about the Maxima