This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
en:operators [2016/01/01 23:10] admin |
en:operators [2016/08/09 18:28] admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
===== Operators ===== | ===== Operators ===== | ||
- | The operators +, -, *, /, and ^ are used to perform addition, subtraction, | ||
- | \\ | ||
- | The operators %, \, &, |, and ~ are used to calculate modulo, integer division, bitwise and, bitwise or, and bitwise negation (not) of integer expressions. | ||
- | \\ | ||
- | The = operator is used both for assignment to variables, and to test for equality. | ||
- | \\ | ||
- | ^Arithmetic Operators^^^^ | ||
- | ^Operator^Name^Example^Comments^ | ||
- | |+|Addition|a + b|add two numric values (if either or both values are a string then the + operator will concatenate)| | ||
- | |-|Subtraction|a - b|subtract two numeric values| | ||
- | |*|Multiplication|a * b| | | ||
- | |/ | ||
- | |\|Integer Division|a \ b|Returns the number of whole times that b goes into a.| | ||
- | |%|Modulo|a % b|Returns the remainder of the integer division of a and b.| | ||
- | |%%++%%|Increment Prefix|%%++a%%|Increment (add one) the the variable and return the value after the increment. (may be applied ONLY to numeric variables or array elements) | ||
- | |%%++%%|Increment Suffix|%%a++%%|Return the value of the variable and then increment the variable by one for the next time it is accessed. (may be applied ONLY to numeric variables or array elements) < | ||
- | |--|Decrement Prefix|--a|Decrement (subtract one) the the variable and return the value after the decrement. (may be applied ONLY to numeric variables or array elements) < | ||
- | |--|Decrrement Suffix|a--|Return the value of the variable and then decrement the variable by one for the next time it is accessed. (may be applied ONLY to numeric variables or array elements) < | ||
- | \\ | ||
- | ^Comparison Operators^^^^ | ||
- | ^Operator^Name^Example^Comments^ | ||
- | |=|Equal|a = b|Returns true of two values are equal| | ||
- | |%%< | ||
- | |%%> | ||
- | |%%< | ||
- | |%%> | ||
- | |%%<> | ||
- | \\ | + | What is an operation and operator... |
- | ^Logical Operators^^^^ | + | |
- | ^Operator^Name^Example^Comments^ | + | |
- | |NOT|Logical Negation|NOT a| | | + | |
- | |AND|Logical Conjunction|a AND b| | | + | |
- | |OR|Logical Disjunction|a OR b| | | + | |
- | |XOR|Logical Exclusive Disjunction|a XOR b| | | + | |
- | \\ | + | {{page> |
- | ^Bitwise Operators^^^^ | + | |
- | ^Operator^Name^Example^Comments^ | + | |
- | |%%~%%|Bitwide Negation|~a| | | + | |
- | |%%& | + | |
- | |%%|%%|Bitwise Disjunction|a %%|%% b|Returns the bits of integer a or integer b.| | + | |
- | \\ | + | {{page> |
- | ^String Operators^^^^ | + | |
- | ^Operator^Name^Example^Comments^ | + | {{page> |
- | |+|Concatenation|a + b|Appends b to the end of a.| | + | |
+ | {{page> | ||
+ | |||
+ | {{page> | ||
+ | |||
+ | {{page> | ||
- | \\ | ||
^Order of Operations^^^ | ^Order of Operations^^^ | ||
^Level^Operators^Category/ | ^Level^Operators^Category/ | ||
Line 64: | Line 30: | ||
|12|XOR|Logical Exclusive Or| | |12|XOR|Logical Exclusive Or| | ||
\\ | \\ | ||
- | < | + | |
+ | === Links to Separate Pages === | ||
+ | |||
+ | [[arithmeticoperators|Arithmetic Operators]] | ||
+ | [[stringoperators|String Operators]] | ||
+ | [[comparisonoperators|Comparison Operators]] | ||
+ | [[logicaloperators|Boolean (Logical) Operators]] | ||
+ | [[variableoperators|variableoperators]] | ||
+ | [[bitwiseoperators|Bit-wise Operators]] | ||