[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Calc: `*' binds more strongly than `/'
From: |
Jay Belanger |
Subject: |
Re: Calc: `*' binds more strongly than `/' |
Date: |
Wed, 20 Jun 2007 15:18:39 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) |
Luc Teirlinck <address@hidden> writes:
...
> if you give * higher precedence than /, as Calc did up to know
> and still does by default now (unless I misunderstood).
That's right.
> I do not know what preference Calc gives to mod, relative to / and *,
> for either value of `calc-multiplication-has-precedence'.
In Calc, the precedence of the mod operator "%" is equal to that of
"/", and so is normally less than that of "*", but "%", "/" and "*"
all have equal precedence if `calc-multiplication-has-precedence' is
nil. (Parentheses are still a good idea, of course, but not
required.) Note that the mod operator "mod", which creates modulo
forms, is different than the mod operator "%", which computes
remainders. 10 mod 4 = 2 mod 4, and 10 % 4 = 2. "mod" has a much
higher precedence.
Jay