Re: Silly question
Re: Silly question
- Subject: Re: Silly question
- From: Ondra Cada <email@hidden>
- Date: Fri, 21 Dec 2001 17:11:52 +0100
Craig,
>
>>>>> Craig S. Cottingham (CSC) wrote at Fri, 21 Dec 2001 08:30:49 -0600:
CSC> 1. Multiplication and division come before addition and subtraction.
...
CSC> ...I don't instantly know if it will be evaluated as
CSC> ( (a && b) || (c && d) )
CSC> or
CSC> ( ( (a && b) || c) && d)
You should -- since it's nothing else than your (1) rule, which you seem to
remember. Or did you forget that && is a (boolean) multiplication, and || is
a (boolean) addition?!?
CSC> I could memorize the precedence tables, I suppose, or look them
Or just think a bit about why those rules were set the way they are, I guess ;)
I agree there are some slightly non-intuitive ones (eg. when it comes to
mixing & with &&, or when the ?: is used), but basic operation precedences
are QUITE straighforward.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc