[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#43902: 28.0.50; Calc: Wrong eval precedence rules with LaTeX languag
From: |
Mattias Engdegård |
Subject: |
bug#43902: 28.0.50; Calc: Wrong eval precedence rules with LaTeX language |
Date: |
Sat, 10 Oct 2020 12:03:25 +0200 |
Michael Heerdegen dixit:
> M-x calc RET
> d L ;; calc-latex-language
> ' ;; calc-algebraic-entry
> 1+1/2 RET
>
> The result is 1, and the Trail shows alg' (1 + 1) / 2. It does not make
> much sense to me to use a precedence rule where addition has higher
> precedence than division. I know LaTeX a bit and don't expect such a
> result, and it doesn't seem to be documented. Is it intended or a bug?
Indeed, $a+b/c$ is typeset by (La)TeX as (approx.) a + b/c which can only mean
one thing, but Calc incorrectly parses it as (a+b)/c. This seems to be the
consequence of an explicit change:
commit fda9b316f84dbc6d68e6cb74b386ee4b92d81b31
Author: Jay Belanger <jay.p.belanger@gmail.com>
Date: Fri Nov 16 04:15:23 2007 +0000
(math-oper-table): Fix typo. Reduce precedence of "/" for TeX.
--- a/lisp/calc/calc-lang.el
+++ b/lisp/calc/calc-lang.el
- ( "/" / 185 186 )
+ ( "/" / 170 171 )
Jay, do you remember the reason for this change?