You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/visual-basic/language-reference/operators/operator-precedence.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ When several operations occur in an expression, each part is evaluated and resol
24
24
25
25
When expressions contain operators from more than one category, they are evaluated according to the following rules:
26
26
27
-
- The arithmetic and concatenation operators have the order of precedence described in the following section, and all have greater precedence than the comparison, logical, and bitwise operators.
27
+
- The arithmetic and concatenation operators have the order of precedence described in the following section, and all have greater precedence than the comparison, logical, and bitwise operators. Higher precedence means these operators are evaluated first.
28
28
29
29
- All comparison operators have equal precedence, and all have greater precedence than the logical and bitwise operators, but lower precedence than the arithmetic and concatenation operators.
30
30
@@ -34,7 +34,7 @@ When several operations occur in an expression, each part is evaluated and resol
34
34
35
35
## Precedence Order
36
36
37
-
Operators are evaluated in the following order of precedence:
37
+
Operators are evaluated in the following order of precedence. Operators listed first have higher precedence and are evaluated before operators listed later:
38
38
39
39
### Await Operator
40
40
@@ -108,7 +108,9 @@ e = 1.0
108
108
f=a-b+c/d*e
109
109
' The preceding line sets f to 7.0. Because of natural operator
110
110
' precedence and associativity, it is exactly equivalent to the
111
-
' following line.
111
+
' following line. Division and multiplication (/, *) have higher
112
+
' precedence than addition and subtraction (+, -), so c / d * e
113
+
' is evaluated first, then the addition and subtraction from left to right.
112
114
f=(a-b)+((c/d)*e)
113
115
' The following line overrides the natural operator precedence
0 commit comments