Operators are used to evaluate metrics in relation to eachother.
Operators are listed in descending order or precedence.
()
Associativity: left to right! -
Associativity: right to left
Note: the-
character is the numeric negation, i.e. the dash in the expression-1
.* / %
Assiciativity: left to right+ -
Assiciativity: left to right
Note: the-
character is the subtraction operation, i.e. the dash in the expression3 - 2 = 1
.<< >>
Assiciativity: left to right
Note: when applied to a floating point value,x << y
will evaluate similar tox * 2^y
, whilex >> y
will evaluate similar tox / 2^y
.< <= > >=
Assiciativity: left to right= !=
Assiciativity: left to right&&
Assiciativity: left to right||
Assiciativity: left to right
Operators will attempt to coerce their arguments to a valid type.
If the operator operates on boolean values, it will attempt to coerce the value to a boolean.
If the the operator operates on numeric value, it will attempt to coerce the value to a number.
Booleans and numeric types are freely coercible between eachother. A numeric value coerced to a boolean will gain true if it is non-zero, otherwise it will gain the value false. A boolean value coerced to a number will gain the value 1, for true, or 0, for false. Strings cannot be coerced to another type.