|
Operator
|
Precedence
|
Unary?
|
Usage
|
Description
|
|
-
|
1
|
Yes
|
-x
|
Unary minus operator
|
|
^
|
2
|
No
|
x ^ y
|
x raised to the power of y
|
|
*
|
3
|
No
|
x * y
|
Multiplication operator
|
|
/
|
3
|
No
|
x / y
|
Division operator
|
|
\
|
3
|
No
|
x \ y
|
Integer divide operator; divides the first operand by the second and rounds the result to an integer (rounding towards zero)
|
|
%
|
3
|
No
|
x % y
|
Modulo; find remainder of the division of x by y
|
|
+
|
4
|
No
|
x + y
|
Addition operator
|
|
-
|
4
|
Yes
|
x - y
|
Subtraction operator
|
|
>
|
5
|
No
|
x > y
|
“Is greater than” logical operator. Returns 1 if true, 0 if false.
|
|
<
|
5
|
No
|
x < y
|
“Is less than” logical operator. Returns 1 if true, 0 if false.
|
|
>=
|
5
|
No
|
x >= y
|
“Is greater than or equal to” logical operator. Returns 1 if true, 0 if false.
|
|
<=
|
5
|
No
|
x <= y
|
“Is less than or equal to” logical operator. Returns 1 if true, 0 if false.
|
|
!
|
6
|
Yes
|
!x
|
“Fuzzy NOT” logical operator. Returns 1-x, but subject to range [0,1].
|
|
&
|
7
|
No
|
x & y
|
“Fuzzy AND” logical operator. Returns min(x,y), but subject to range [0,1].
|
|
|
|
8
|
No
|
x | y
|
“Fuzzy OR” logical operator. Returns max(x,y), but subject to range [0,1].
|