C (134/207)

From:Volker Barthelmann
Date:21 Dec 99 at 23:54:01
Subject:Re: Re: Stupid operator precedence...

From: Volker Barthelmann <volker@vb.franken.de>

On Mon, 20 Dec 1999, Allan Odgaard wrote:

> > It shouldn't pose a problem if you parenthisize your
> > equations sufficiently, it also makes it more readable,
> > your intensions are better understood too...
>
> That explanation did not make my life any better... ;-)

It's for historical reasons. IIRC BCPL or at least a very early version of
C didn't have the logical and/or (&&/||) but only the bitwise. Therefore
you had to write something like if(a==b&b==c) which was the reason for the
precedence.

At least that's how I recall it at the moment. There should be an article
of Dennis Ritchie somewhere on the net. I don't know the URL offhand but
if you can't find it I can look it up.

Hope that makes your life better. :-)

Volker