[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#37235: 26.1; Precedence error in calc-eval
From: |
Andreas Schwab |
Subject: |
bug#37235: 26.1; Precedence error in calc-eval |
Date: |
Fri, 30 Aug 2019 17:07:08 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
On Aug 30 2019, Charles Karney via "Bug reports for GNU Emacs, the Swiss army
knife of text editors" <bug-gnu-emacs@gnu.org> wrote:
> The precedence of calc-eval doesn't follow C-like rules.
>
> (calc-eval "1/2*3") returns "0.166666666667"
>
> returning the same answer as (calc-eval "1/2/3"). It should return
> "1.5".
It is documented that multiplication has higher precedence than
devision (see (calc) Formulas). Calc is following the rules of
Algebra.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."