Note: Logical operators return 1.0 for true and 0.0 for false. Since they return values, you can perform logical AND and OR with addition and multiplication. For example: ((a<b) + (b>c)) tests for a < b or b > c. ((a<b)*(b>c)) tests for a<b and b>c.
| Symbol |
Operator Definition |
| = |
logical equals |
| != |
logical not equals |
| ! |
logical not |
| < |
logical less-than |
| > |
logical greater-than |
| <= |
logical less-than or equals |
| >= |
logical greater-than or equals |
| And |
boolean "AND" |
| ~ |
logical approximately equal |
| <~ |
logical less-than or approximately equal |
| >~ |
logical greater-than or approximately equal |
| Or |
boolean "OR" |
| + |
binary addition |
| - |
binary subtraction |
| * |
binary multiplication |
| / |
binary division |
| - |
unary minus |
| + |
unary plus |
| ^ |
power |