• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Silly question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Silly question
      • From: "Clark S. Cox III" <email@hidden>
  • Prev by Date: Re: CriticalAlert
  • Next by Date: Re: CriticalAlert
  • Previous by thread: Re: Silly question
  • Next by thread: Re: Silly question
  • Index(es):
    • Date
    • Thread