Monday, 8 August 2011

Learning about Variables: More Complicated Expressions

0 comments
 
You can use the following operators in expressions:


+ Plus
- Minus
* Multiply
/ Division
( Openning parenthesis
) Closing parenthesis
^ Power


For example, this is a valid expression:
(Blah + 5) * MySecondVariable - (4 + 10 / Blah)

The order of the operators are like in math:
First "(" and ")" , then "^", then "*" and "/", and at last "+" and "-"

For example:
2 + 3 * 4   is equal to 14
(2 + 3) * 4   is equal to 20

Leave a Reply