> > Brackets
> > Exponents
> > Divison*
> > Multiplication*
> > Addition**
> > Subtraction**
>
>
> Actually that list should be written so that it's clear that eg.
> addition and substraction have the same precedence. Having the same
> precendence is completely different from being contiguous in the
precedence
> list, but one having higher precedence than the other.
> The general rule is that when there is more than one operator with the
> same precedence, they are evaluated from left to right. Operators with
> different precedences are evaluated in decreasing order of precedence.
> This means that "2-3+4" evaluates to a different value depending on this
> difference.
>
Sorry, it's just the mnemonic for OoO that (almost) everyone learns in grade
school. Not really meant for higher thinking.
-tgq
Post a reply to this message
|