[Tutor] a puzzle about -3**2 vs (-3)**2

D Wyatt fiberfolly at gmail.com
Sun Aug 2 02:26:27 CEST 2015


<snip>
>
> According to Wikipedia:
>
> https://en.wikipedia.org/wiki/Order_of_operations
>
> some scientific journals now treat multiplication as a higher precedence
> than division with a / so that 1/2x equals 1/(2x), not (1/2)x.
>
> There's an interesting study done here:
>
> "Developer beliefs about binary operator precedence"
>
> http://www.knosof.co.uk/cbook/accu06.html
>
> which suggests that even professional programmers get operator
> precedence wrong at a high rate. (The study found a 33% error rate.)
>
> The bottom line is, there is no universal right or wrong answer for the
> precedence rules for operators, although some rules are less right than
> others.
>
>
>
> --
> Steve

Interesting info.  Thanks for following up on this.


-- 
Deb Wyatt in WA


More information about the Tutor mailing list