Arithmetic Operators
Name | Syntax | Description | Example | Output |
---|---|---|---|---|
Addition |
|
Adds two numbers together |
|
|
Subtraction |
|
Subtracts two numbers together |
|
|
Multiplication |
|
Multiplies two numbers together |
|
|
Division |
|
Divides the first number by second number. |
|
|
Modulo |
|
Finds the remainder when first number is divided by the second number. Only use Modulo on integer values. |
|
|
Parenthesis |
|
Dictates the order in which operations are done. |
|
|
Assignment Operators
Name | Syntax | Description | Example | Equivalent Operation |
---|---|---|---|---|
Addition Assignment |
|
Adds the current data value with another |
|
|
Subtraction Assignment |
|
Subtracts the current data value with another |
|
|
Multiplication Assignment |
|
Multiplies the current data value with another |
|
|
Division Assignment |
|
Divides the current data value with another |
|
|
Modulo Assignment |
|
Takes the remainder when the current data value is divided by another value |
|
|
Increment |
|
Increases the current data value by 1 |
|
|
Decrement |
|
Decreases the current data value by 1 |
|
|
Relational Operators
Name | Symbol | Description | Examples | Result |
---|---|---|---|---|
Equal to |
|
Checks if two values are the same |
|
|
Not equal to |
|
Checks it two values are different |
|
|
Greater than |
|
Checks if the first value is greater than the second |
|
|
Less than |
|
Checks if the first value is less than the second |
|
|
Greater than or equal to |
|
Checks if the first value is greater than or equal to the second value |
|
|
Less than or equal to |
|
Checks it the first value is less than or equal to the second value |
|
|
Logical Operators
Name | Symbol | Description | Examples | Result |
---|---|---|---|---|
AND |
|
Returns true only if both sides are true |
|
|
OR |
|
Returns true when either side is true |
|
|
false` |
|
NOT |
|
Returns true if false and returns false if true |
Other Operators
Name | Symbol | Description | Example | Result |
---|---|---|---|---|
XOR |
|
This is a bitwise operator. It can be used as a logical operator. It compares 2 boolean values and results true if only one of them are true. |
|
|