Skip to main content

Operators

The following logical, arithmetic and comparison operators can be used within an expression:

  • Arithmetical:
    • +: Addition
    • -: Subtraction
    • /: Division
    • *: Multiplication
  • Logical:
    • &&: Logical AND
    • ||: Logical OR
    • ^: Logical XOR
    • !: Logical NOT
  • Comparison:
    • >: Greater than
    • <: Less than
    • =: Equal to
    • !=: Not equal to
    • >=: Greater than or equal to
    • <=: Less than or equal to

When working with logical and comparison operators, it is crucial to ensure that the data types being compared are compatible. For instance, comparing a string to a number using an operator like > may not yield the expected results. Always ensure that the variables and constants in your expressions have expected and consistent types to avoid unexpected behaviors.