## Operators

In

mathematics, an

*operator* is a symbol that expresses the

*operation* to be performed. In

LSL, operators perform simple "common-sense" operations on

values. The

assignment operators are special in that the left hand side of the operation must be a

variable.

**Operator Types** | **Description** | **Examples** |

Unary | Operators that act on one value | ++, --, ~, ! |

Binary | Operators that act on two values. | +, -, *, /, %, +=, -=, *=, /=, %=, &&, ||, !, ==, !=, <=, <, >=, > |

Boolean | Operators that work with TRUE and FALSE values. | &&, ||, !, ==, !=, <=, <, >=, > |

Bitwise | Operators that work with bitfields | &, |, ~, ^, <<, >> |

Assignment | Special operators that assign a value to a variable. | =, +=, -=, *=, /=, %= |

All operators in order of execution or precedence, from high to low:

**Operation ** | **Description** |

`() [] .` | `Parentheses, Square Brackets and Dot Operator` |

`! ~ ++ --` | `NOT, One's Complement, Increment, Decrement` |

`* / %` | `Multiply, Divide, Modulus (% is also Vector Cross)` |

`+ -` | `Addition and Subtraction` |

`<< >>` | `Left Shift, Right Shift` |

`< <= > >=` | `Less Than, Less Than Or Equal To, Greater Than, Greater Than or Equal To` |

`== !=` | `Comparison Equal, Comparison Not Equal` |

`&` | `Bitwise AND` |

`^` | `Bitwise XOR` |

`|` | `Bitwise OR` |

`||` | `Comparison OR` |

`&&` | `Comparison AND` |

`= += -= *= /= %=` | `Assignment` |

Math

Operators |

Unary |

Binary |

Bitwise |

Boolean |

Equality |

Assignment