^ | (exponent) |
* | (multiplication) |
/ | (division) |
+ | (addition) |
- | (subtraction) |
% | (remainder) |
mod | (modulus) |
& | (bitwise and) |
| | (bitwise or) |
|| | (bitwise xor) |
~ | (bitwise not) |
<< | (shift left) |
>> | (shift right signed) |
>>> | (shift right unsigned) |
<= | (less than or equal) |
<> | (not equal to) |
>= | (greater than or equal) |
= | (equal) |
> | (greater than) |
< | (less than) |
And | (logical and) |
Or | (logical or) |
Not | (logical not) |
( ) | (parenthesis) |
( ) | |
functions(x) | |
-{unary minus} Not ~ | |
^ | |
* / % mod | |
+ - & | || << >> >>> | |
<= <> >= = > < | |
And Or |
A variable represents a quantity that may assume different values during the execution of a program.
For example, A = 3 assigns the value 3 to the variable A.
Here is a simple program using variables to do a calculation: |
When you run this program the value 8 is printed.
As of Version 3.4 the expression parser accepts conditional operations in expressions.
Expressions like this are now possible:
A = (x > 2)
In this expression, if x is greater than 2 A would equal 1. If x was not greater than 2 A would equal 0.
Strings may be included in the comparison and result in 0 or 1.
x = ("This" + "is" > "Cool")*("Isn't" < "It?")
x = 1