...
Arithmetic operators
Arithmetic operators
Arithmetic operators are symbols that represent mathematic functions.
...
Code Block |
---|
|
// Declare variable
int $inside = 1;
// Shortcut for expression $inside = $inside + 9
$inside += 9;
// Shortcut for expression $inside = $inside –2
$inside -= 2;
// Shortcut for expression $inside = $inside 10
$inside *= 10;
print $inside;
//declare variable
vector $outside = <<2,2,2>>;
// Shortcut for expression $outside += $outside + <<<<1,2,3>>
$outside += <<1,2,3>>;
print $outside; |
...
anchorComparison operators
Comparison operators are used to compare two values and evaluate whether a statement is true based on the relation of the value on the left to the value on the right and then execute the statement accordingly.
...
Code Block |
---|
|
test condition ? operation1 : operation2
int $markers = 5 < 9 ? 40 : 50; // Value: 40 |
...
anchorLogical operators
Logical operators are used to compare two values and evaluate whether a statement is true or false and then execute the statement accordingly. Logical operators create boolean results, that is, values of either TRUE or FALSE.
...