News for hackers. Stuff that matters.
Re:6÷2(1+2)=? by ColinWright on Sunday March 17, 2013 @07:10PM (#5391498)
I blogged about this nearly two years ago:

http://www.solipsys.co.uk/new/AMatterOfConvention.html?HN

Re:6÷2(1+2)=? by StevenXC on Sunday March 17, 2013 @07:19PM (#5391523)
Yeah, tale as old as time, right? It's making the rounds on social media currently, so I thought it was relevant.

I agree with your interpretation FTA:

> DON'T DO THIS!

> It's ambiguous, and should not be written like this because it leads to problems.

Re:6÷2(1+2)=? by ari_elle on Sunday March 17, 2013 @07:17PM (#5391518)
Nice, i would have said 9 just because that's how C interprets it.

float x = 6 / 2 * (2 + 1); // x == 9

Re:6÷2(1+2)=? by beatgammit on Sunday March 17, 2013 @07:50PM (#5391633)
Right, but you also had to explicitly add the asterisk for multiplication. I thought the same thing, but the remarks on juxtaposition do have a point. For example, if an integer were callable, you'd do the function call--2(2+1)--independantly of the division.