I have some code, that does a comparison to find how many of set of values fall within a range defined by a mean±sd, like this:
sum(mean - sd < value & value < mean + sd )
Most discussions of the order of operations only include basic functions (PEDMAS - parentheses, exponentials, division, multiplication, addition and subtraction). This says nothing about the order of operations for boolean functions or comparisons. Obviously I could clarify things with some parentheses:
sum(((mean - sd) < value) & (value < (mean + sd)))
In the language I was using (R), this happened to work exactly the same anyway, but I wasn't sure if that is something I should take for granted. Is there a standard language-agnostic order of operations that includes arithmetic operators and logical operators? Are there other operations that should be included in such a list?