emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calc: `*' binds more strongly than `/'


From: Christian Schlauer
Subject: Re: Calc: `*' binds more strongly than `/'
Date: Wed, 18 Apr 2007 23:29:55 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.98 (gnu/linux)

address@hidden (Randal L. Schwartz) writes:

>>>>>> "Christian" == Christian Schlauer
>>>>>> <address@hidden> writes:
>
> Christian> I believe (but I do not know) that Calc's behaviour is
> Christian> (too) far from what `ordinary' people (like me ;-) would
> Christian> expect: I ran into this feature in my first table and
> Christian> wondered what was going on. I thought that Org-mode
> Christian> calculates `wrong'.
>
> You mean from what *programmers* think. Keep in mind that Calc was
> designed by a mathematician, and it's much more natural in math to
> have * have higher precedence than /. There's no promise that the
> order of operations is like programmer-think. I got used to it quite
> quickly when I was playing with Calc during its initial development.

Hm. I'm an engineer, not a programmer ;-) I can only say that Calc
seems to be a fantastic tool, especially when one is on a computer
where the `heaviest' math tool installed is some spreadsheet.

But I wouldn't recommend it to an engineer as it doesn't work in the
way I (and spreadsheet-users) am used to, that is left-to-right
evaluation in absence of parentheses.

I didn't think that my expectation of the order of operations is like
programmers think. I learned in school that when I write on paper

2 * 3
-----
4 * 5

I have to enter it in my pocket calculator (Casio) as 2*3/(4*5), and
it seems that Jay found the same behaviour with other brands. So it
starts with the school kids, not with programmers.

> I suggest it not be changed. It will break old code (Calc has been
> around for almost two decades)

That's the risk. I'm surprised: am I the first one to complain about
this feature? In 20 years? But then, Calc hasn't been bundled with
Emacs until now.

> it's a minor thing

I don't agree. When I write a formula for a table in Org-mode, I
always have to check it carefully as Calc does not work like Gnumeric,
Openoffice's spreadsheet, MATLAB, Excel, ... I simply have a bad
feeling when typing the formula due to this feature and the fact that
it makes using Calc more error-prone for me (and for all those
familiar with the spreadsheet programs mentioned before).

> and people have eventually stumbled on it, and it's well (over?)
> documented.

It is well-documented, but it is an unnecessary trap, IMO.

Regards,

Christian Schlauer





reply via email to

[Prev in Thread] Current Thread [Next in Thread]