Content deleted Content added
Enterprisey (talk | contribs) break out a new section |
Enterprisey (talk | contribs) m →Operator associativity: clarify a sentence |
||
Line 17:
Mathematically oriented languages (such as on [[scientific calculator]]s) sometimes allow implicit multiplication with higher priority than prefix operators (such as sin), so that sin 2x+1 = (sin(2x))+1, for instance.{{fact|date=November 2015|reason=While this may be correct for some languages, it is not correct mathematically. This needs to be discussed in much better details. See also [[Order of operations]].}}
However, prefix (and postfix) operators do not ''necessarily'' have higher precedence than all infix operators. Some (hypothetical) programming language may well have an operator called sin with a precedence lower than × but higher than + for instance. In such a language, sin 2·x+1 = sin(2·x)+1 would be true, instead of (sin 2)·x+1, as
The rules for expression evaluation are usually three-fold:
|