This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Operator precedence  RSS feed

 
Greg Charles
Sheriff
Posts: 3014
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How much does SCP 1.4 depend on knowing operator precedence? I don't see it listed among the exam objectives, but some of the questions in the K&B Self Test for Chapter 3 rely on, for example, knowing that && has a higher precedence than || and knowing that + is evaluated left to right. Does the real exam also require you to know that?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't remember exactly - I would say the 1.4 exam does not require extensive knowledge of the precedence of all operators. Or if it does, I didn't happen to get those questions when I took the exam. Personally I just remember that * and / are before + and -, which are before any relational operators, which are before && which is before ||. So I can correctly evaluate something like

if (x + 2 * y > 7 || x < 0 && y == 0)

though in real life of course I'd want some parens in there.

That's probably more than you need to know for the exam, but my point is that if the exam had required more than that from me, I'd probably remember that fact now. The exam probably doesn't expect you to know that && is before ||, and may well require less than that - but I couldn't say how much less.

Hope that helps...
[ March 10, 2006: Message edited by: Jim Yingst ]
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!