Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I recommend reading this page to understand how most of these work: http://www.cplusplus.com/doc/tutorial/operators/
- Arithmetics:
- (x = y) : Assignment
- (x + y) : Addition
- (x - y) : Subtraction
- (x * y) : Multiplication
- (x / y) : Division
- (x % y) : Modulo
- (x ** y) : Exponentiation [xʸ]
- (x++) : Increment postfix
- (x--) : Decrement postfix
- (++x) : Increment prefix
- (--x) : Decrement prefix
- Vector math:
- (x cross y) : Cross product
- (x dot y) : Dot product
- Comparison:
- (x == y) : Equality comparison
- (x != y) : Inequality comparison
- (x > y) : Greater than comparison
- (x < y) : Lesser than comparison
- (x >= y) : Greater than or equal to comparison
- (x <= y) : Lesser than or equal to comparison
- (x <>= y) : Three-way comparison [https://en.wikipedia.org/wiki/Three-way_comparison]
- (x ~== y) : Case insensitive string equality comparison
- Logical operators:
- (!x) : Logical negation/NOT [https://en.wikipedia.org/wiki/Negation]
- (x && y) : Logical AND [https://en.wikipedia.org/wiki/Logical_conjunction]
- (x || y) : Logical OR [https://en.wikipedia.org/wiki/Logical_disjunction]
- Bitwise operators:
- (~x) : Bitwise negation [https://en.wikipedia.org/wiki/Bitwise_operation#NOT]
- (x & y) : Bitwise AND [https://en.wikipedia.org/wiki/Bitwise_operation#AND]
- (x | y) : Bitwise OR [https://en.wikipedia.org/wiki/Bitwise_operation#OR]
- (x ^ y) : Bitwise XOR [https://en.wikipedia.org/wiki/Bitwise_operation#XOR]
- (x << y) : Bitwise left shift [https://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts]
- (x >> y) : Bitwise right shift [https://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts]
- (x >>> y) : Unsigned bitwise right shift [https://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts]
- Misc operators:
- (x ? y : z) : Ternary conditional [https://en.wikipedia.org/wiki/%3F:]
- (x.y) : Member access
- (x .. y) : String concatenation
- (x is y) : Ancestry comparison [https://zdoom.org/wiki/ZScript_special_words]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement