[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#923: In CVS Emacs, calc-eval gives multiplication higher precidence
From: |
Stefan Monnier |
Subject: |
bug#923: In CVS Emacs, calc-eval gives multiplication higher precidence than division |
Date: |
Sun, 07 Sep 2008 17:15:38 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
>>> That's not a bug. While many systems give division a higher precendence
>>> than multiplication, that isn't a universal rule.
>> Actually, I don't know of any system that gives higher precedence to
>> division.
> According to Wikipedia:
> An expression like 1/2x is interpreted as 1/(2x) by TI-82, but as
> (1/2)x by TI-83. While the first interpretation may be expected by
> some users, only the latter is in agreement with the standard rules
> stated above.
That could be due to a higher precedence, but could also be due to an
equal precedence together with left-associativity. Given that (a*b)/c
is often mathematically equal to a*(b/c), the difference is generally
hard to see, unless rounding comes into play.
All textbooks and language references I know use the "equal precedence
and left associativity" rule rather than giving higher precedence to
the division.
>> The general rule that (AFAIK) all programming languages
>> follow (other than those that don't use infix-with-precedence, such as
>> Lisp and Smalltalk) is that * and / have the same precedence (and are
>> left associative).
> That behavior is available, but you have to ask for it by setting
> `calc-multiplication-has-precedence' to nil.
I know. But we're talking about the default behavior.
Stefan
- bug#914: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Francis Litterio, 2008/09/07
- bug#915: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Jay Belanger, 2008/09/07
- bug#918: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Francis Litterio, 2008/09/07
- bug#920: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Stefan Monnier, 2008/09/07
- bug#920: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Lennart Borgman (gmail), 2008/09/07
- bug#921: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Jay Belanger, 2008/09/07
- bug#923: In CVS Emacs, calc-eval gives multiplication higher precidence than division,
Stefan Monnier <=
- bug#924: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Lennart Borgman (gmail), 2008/09/07
- Message not available
- bug#928: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Carsten Dominik, 2008/09/08
- bug#929: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Lennart Borgman, 2008/09/08
- bug#932: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Carsten Dominik, 2008/09/08
- bug#933: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Lennart Borgman (gmail), 2008/09/08
- bug#934: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Randal L. Schwartz, 2008/09/08
- bug#914: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Lennart Borgman (gmail), 2008/09/08
- bug#937: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Stefan Monnier, 2008/09/08
- bug#941: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Richard M. Stallman, 2008/09/09
- bug#944: In CVS Emacs, calc-eval gives multiplication higher precidence than division, Stefan Monnier, 2008/09/09