3 ms·
I blogged about this nearly two years ago: http://www.solipsys.co.uk/new/AMatterOfConvention.html?HN http://www.solipsys.co.uk/new/AMatterOfConvention.html?HN
by ColinWright 14y ago
I blogged about this nearly two years ago:
http://www.solipsys.co.uk/new/AMatterOfConvention.html?HN http://www.solipsys.co.uk/new/AMatterOfConvention.html?HN
- ari_elle 14y agoNice, i would have said 9 just because that's how C interprets it. float x = 6 / 2 * (2 + 1); // x == 9
- beatgammit 14y agoRight, 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.
- StevenXC 14y agoYeah, 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.