Home / Definitions / Precedence

Precedence

Webopedia Staff
Last Updated May 24, 2021 7:52 am
A characteristic of operators that indicates when they will be evaluated when they appear in complex expressions. Operators with high precedence are evaluated before operators with low precedence. For example, the multiplication operator (*) has higher preference than the addition operator (+), so the expression

2+3*4

equals 14, not 20.

You can override precedence rules by surrounding parts of an expression with parentheses. For example,

(2+3)*4

would evaluate to 20.