[Maxima] Parsing 2^-3*4 (WAS Maxima latex output)
Wed Nov 1 22:43:55 CST 2006
On 10/25/06, Richard Fateman <fateman at cs.berkeley.edu> wrote:
> I think that it is basically a hack on the parser to allow 2 operators to be
> adjacent, in each case of the unary - or unary +. One way around this is to
> forbid 2 adjacent operators, and anyone who is tempted to use this
> construction would get an error message, and then would insert parentheses
> as appropriate.
Now that, surely, is a real hack.
> This discussion happened at least two previous times between 1968 and 1974.
A testament to the longevity of this topic, and this project ....
If we're lucky we'll have the same discussion in 2048 as well.
> > By the way, this business with operator precedence bears on
> > at least one reported bug, which has to do with the value of
> > 1/+3*2 (or something like that). At present Maxima says that
> > is 1/6, which consistent with F77. That is a consequence of
> > the right binding power for + , which is 100 (i.e. less than * ).
> > We could resolve that bug by approving the current behavior,
> > and changing rbp of - to be 100 also, for consistency. Just a thought.
I've thought twice about this, and I've decided that it would be
less surprising to give + the same rbp as - (namely 134).
Then 1/-3*2 => -2/3 (current behavior) and 1/+3*2 => 2/3 (new).
After making that change, run_testsuite reports no unexpected errors.
All the best
More information about the Maxima