Operators

  • + addition
  • - subtraction
  • * multiplication
  • / Floating point division
  • // Division, but the result is going down
  • % Modulus operation,Division remainder
  • ^ power operation
  • ~= Not equal to
  • = assignment operation
  • .. String concatenation operator, which can be used to connect two strings
  • == Equal to compare
  • > greater than
  • < less than
  • >= great than or equal to
  • <= less than or equal to
  • & bit AND operation
  • | bit OR operation
  • ~ bit Negation operation
  • >> bit MoveRight
  • << bit MoveLeft
  • ‘and’ And,for example,true and false,’and’ and ‘or’ operator joins multiple expressions,if it’s not a single sign expression,to avoid compilation errors caused by priority.Please add a pair of ( )  on complex expressions of and/or both sides.For example (2>1) and (1>2)
  • ‘or’ Or,for example,true or nil
  • ‘not’ the inverse of Boolean operator
  • # An array or string length operator,for example,#array