Advertisement
Chronos_Ouroboros

ZScript operators

Jan 30th, 2018
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. I recommend reading this page to understand how most of these work: http://www.cplusplus.com/doc/tutorial/operators/
  2.  
  3. Arithmetics:
  4. (x = y) : Assignment
  5. (x + y) : Addition
  6. (x - y) : Subtraction
  7. (x * y) : Multiplication
  8. (x / y) : Division
  9. (x % y) : Modulo
  10. (x ** y) : Exponentiation [xʸ]
  11. (x++) : Increment postfix
  12. (x--) : Decrement postfix
  13. (++x) : Increment prefix
  14. (--x) : Decrement prefix
  15.  
  16. Vector math:
  17. (x cross y) : Cross product
  18. (x dot y) : Dot product
  19.  
  20. Comparison:
  21. (x == y) : Equality comparison
  22. (x != y) : Inequality comparison
  23. (x > y) : Greater than comparison
  24. (x < y) : Lesser than comparison
  25. (x >= y) : Greater than or equal to comparison
  26. (x <= y) : Lesser than or equal to comparison
  27. (x <>= y) : Three-way comparison [https://en.wikipedia.org/wiki/Three-way_comparison]
  28. (x ~== y) : Case insensitive string equality comparison
  29.  
  30. Logical operators:
  31. (!x) : Logical negation/NOT [https://en.wikipedia.org/wiki/Negation]
  32. (x && y) : Logical AND [https://en.wikipedia.org/wiki/Logical_conjunction]
  33. (x || y) : Logical OR [https://en.wikipedia.org/wiki/Logical_disjunction]
  34.  
  35. Bitwise operators:
  36. (~x) : Bitwise negation [https://en.wikipedia.org/wiki/Bitwise_operation#NOT]
  37. (x & y) : Bitwise AND [https://en.wikipedia.org/wiki/Bitwise_operation#AND]
  38. (x | y) : Bitwise OR [https://en.wikipedia.org/wiki/Bitwise_operation#OR]
  39. (x ^ y) : Bitwise XOR [https://en.wikipedia.org/wiki/Bitwise_operation#XOR]
  40. (x << y) : Bitwise left shift [https://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts]
  41. (x >> y) : Bitwise right shift [https://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts]
  42. (x >>> y) : Unsigned bitwise right shift [https://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts]
  43.  
  44. Misc operators:
  45. (x ? y : z) : Ternary conditional [https://en.wikipedia.org/wiki/%3F:]
  46. (x.y) : Member access
  47. (x .. y) : String concatenation
  48. (x is y) : Ancestry comparison [https://zdoom.org/wiki/ZScript_special_words]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement