Programming Gambas from Zip/OperatorPrecedence
Tools
General
Sister projects
In other projects
In an expression, which part gets worked out first, then which operations are worked out next?
For example, is 2 + 3 * 4 equal to 20 (+ first, * second) or is it 14 (* first, then +)? Multiplication precedes addition, so the expression comes down to14.
Rules:
Examples:
4 ^ 2 * 3 ^ 3is the same as (4 ^ 2) * ( 3 ^ 3 )
a > 10 AND a < 20is the same as ( a > 10 ) AND ( a < 20 )
4 * 2 + 3 * 3is the same as ( 4 * 2 ) + ( 3 * 3 )
4 + 2 = 5 + 1is the same as ( 4 + 2 ) = ( 5 + 1 )
| Programming Gambas from Zip | ||
| ← Formatting | OperatorPrecedence | Afterword → |