We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexSuggestions & BugsWebsite,  Documentation,  Book Bugs › Operator Precedence help in learning center
Page Index Toggle Pages: 1
Operator Precedence help in learning center (Read 863 times)
Operator Precedence help in learning center
Mar 13th, 2008, 4:41am
 
http://processing.org/learning/basics/operatorprecedence.html

For example, in the statement "4 + 28", the 2 will first be multiplied by 8 and then the result will be added to 4. This is because the "*" has a higher precedence than the "+". To avoid ambiguity in reading the program, it is recommended that is statement is written as "4 + (28)"

"4 + 28" and "4 +(28)" should be "4 + 2 * 8" and "4 + (2 * 8)"
Re: Operator Precedence help in learning center
Reply #1 - Mar 13th, 2008, 5:30pm
 
Hi,

I think you lost some of the "*" operators along the way, but rewriting the example your way would make the example pointless...

It's supposed to be about operator precedence. Placing "( )" would not show how the precedence of "+" and "*" works.
Re: Operator Precedence help in learning center
Reply #2 - Mar 15th, 2008, 3:28am
 
Jorge, I did not miss the "*" operators. They are actually missing in the documentation.

My point is: "*" operators are missing in the documentation. Smiley

So the documentation and my suggestion is correct, as far as paranthesis goes but the * operators are missing.

Hope that is clearer now.
Re: Operator Precedence help in learning center
Reply #3 - Mar 15th, 2008, 10:57am
 
I completely missed it. I didn't realize you where quoting and I only looked at the code.

You're right of course.

Sorry for the confusion...

Jorge
Re: Operator Precedence help in learning center
Reply #4 - Mar 27th, 2008, 5:10am
 
Thanks for catching this. It's actually correct in the original code. The HTML conversion process is stripping out the " * ". I'll fix it.
Page Index Toggle Pages: 1