|
From: | Lennart Borgman (gmail) |
Subject: | Re: In CVS Emacs, calc-eval gives multiplication higher precidence than division |
Date: | Tue, 09 Sep 2008 19:03:36 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 |
Stefan Monnier wrote: >> What Calc does now is clearly correct. > > And we clearly disagree. On way of getting out of this trouble would perhaps be to distinguish between an explicit and an implicit `*'. In the explicit case the normal precedence rules should be used, but in the implicit case the current precedence rules might be used instead. The basis for this would be that way allude on the common formula notation. Doing this then 8 / 2 * 2 = (8 / 2) * 2 = 8 and 8 / 2 2 => 8 / (2 * 2) = 2 The first example above follow normal math syntax and semantics. The second example is rather close to what is often used in formulas, like ax/by + cz => (a * x) / (b * y) + c * z Normally this kind of syntax is of course used in a well defined context where you want a short notation for formulas. But it looks like Calc has been striving towards the second in an attempt to make it easier to enter data. I don't think that this is a bad idea. The goal to make it easier to enter data have been reach, but unfortunately a by product has been that Calc mixes the two common cases of syntax/semantics that are most widely used as far as I know. However in my opinion distinguishing the cases like above might be a good solution.
[Prev in Thread] | Current Thread | [Next in Thread] |