You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| ^ | exponentiate | Raises one number to the power of another, e.g. 2 ^ 2 is 4|
23
-
| % | modulus | Returns the remainder of a number, e.g. 5 % 2 is 1|
24
-
| MOD | modulus | Returns the remainder of a number, e.g. 5 mod 2 is 1|
25
-
|\| integer divide | Divides giving an integer result, e.g. 7 \ 2 is 3|
26
-
| ++ | increment | Increments a number. Can be used before or after an assignment, e.g. a = b++ would assign the value of b to a, then increment b. a = ++b would increment b, then assign the new value to a. In both cases, b would be incremented. **(not thread safe, see below)**|
27
-
|**--**| decrement | Decrements a number. Can be used before or after an assignment, e.g. a = b-- would assign the value of b to a, then decrement b. a = --b would decrement b, then assign the new value to a. In both cases, b would be decremented. **(not thread safe, see below)**|
28
-
| += | Compound add | A shorthand operator for adding to a value, e.g. a **+=** b is equivalent to writing a = a + b|
29
-
| -= | Compound subtract | A shorthand operator for subtracting from a value, e.g. a **-=** b is equivalent to writing a = a *-* b|
30
-
|***=**| Compound multiply | A shorthand operator for multiplying a value, e.g. a ***=** b is equivalent to writing a = a * b |
31
-
|**/=**| Compound divide | A shorthand operator for dividing a value, e.g. a /= b is equivalent to writing a = a / b |
18
+
|**+**| Add |Add numbers, e.g. `2 + 2` is 4|
19
+
|**-**| subtract |Subtract numbers, e.g. `2 - 2` is 0|
20
+
|\*| multiply |Multiply numbers, e.g. `2 * 3` is 6|
21
+
| / | divide |Return the quotient of a number, e.g. `6 / 2` is 3|
22
+
| ^ | exponentiate | Raises one number to the power of another, e.g. `2 ^ 2` is 4|
23
+
| % | modulus | Returns the remainder of a number, e.g. `5 % 2` is 1 |
24
+
| MOD | modulus | Returns the remainder of a number, e.g. `5 mod 2` is 1 |
25
+
|\| integer divide | Divides giving an integer result, e.g. `7 \ 2` is 3 |
26
+
| ++ | increment | Increments a number. Can be used before or after an assignment, e.g. `a = b++` would assign the value of b to a, then increment b. `a = ++b` would increment b, then assign the new value to a. In both cases, b would be incremented. **(not thread safe, see below)**|
27
+
|**--**| decrement | Decrements a number. Can be used before or after an assignment, e.g. `a = b--` would assign the value of b to a, then decrement b. `a = --b` would decrement b, then assign the new value to a. In both cases, b would be decremented. **(not thread safe, see below)**|
28
+
| += | Compound add | A shorthand operator for adding to a value, e.g. `a += b` is equivalent to writing `a = a + b`|
29
+
| -= | Compound subtract | A shorthand operator for subtracting from a value, e.g. `a -= b` is equivalent to writing `a = a - b`|
30
+
|***=**| Compound multiply | A shorthand operator for multiplying a value, e.g. `a = b` is equivalent to writing `a = a * b`|
31
+
|**/=**| Compound divide | A shorthand operator for dividing a value, e.g. `a /= b` is equivalent to writing `a = a / b`|
32
32
33
33
### Demonstration of unsafe threaded behavior with ++ and -- operators ###
34
34
@@ -92,42 +92,42 @@ description: Mathematical, Logical, Ternary, Comparison, String and Elvis Operat
92
92
| --------- | -------------- | ----------- |
93
93
| ! | logical inversion | ! true is false |
94
94
| NOT | logical inversion | not true is false |
95
-
| AND | logical and | Returns true if both operands are true, e.g. 1 eq 1 and 2 eq 2 is true|
96
-
| && | logical and | Returns true if both operands are true, e.g. 1 eq 1 && 2 eq 2 is true|
97
-
| OR | logical or | Returns true if either or both operands are true, e.g. 1 eq 1 or 2 eq 3 is true|
98
-
|**\|\|**| logical or | Returns true if either or both operand are true, e.g. 1 == 1 **\|\|** 2 == 3 is true |
99
-
| XOR | logical exclusive or | Returns true if either operand is true, but not both, e.g. 1 == 1 XOR 2 == 3 is true, but 1 == 1 XOR 2 == 2 is false |
95
+
| AND | logical and | Returns true if both operands are true, e.g. `1 eq 1 and 2 eq 2` is true|
96
+
| && | logical and | Returns true if both operands are true, e.g. `1 eq 1 && 2 eq 2` is true|
97
+
| OR | logical or | Returns true if either or both operands are true, e.g. `1 eq 1 or 2 eq 3` is true|
98
+
|**\|\|**| logical or | Returns true if either or both operand are true, e.g. `1 == 1 \|\| 2 == 3` is true |
99
+
| XOR | logical exclusive or | Returns true if either operand is true, but not both, e.g. `1 == 1 XOR 2 == 3` is true, but `1 == 1 XOR 2 == 2` is false |
100
100
101
101
## Comparison operators ##
102
102
103
103
| operators | Name | Description |
104
104
| --------- | -------------- | ----------- |
105
-
| EQ | equals | Returns true if operands are equal, e.g. "A" EQ "A" is true |
106
-
| == | equals | Returns true if operands are equal, e.g. "A" == "A" is true |
107
-
| === | identical | Returns true if operands are the same object in memory, false if they are not, (Note this is different than how JavaScript's === operator works. **Lucee 6 === works like javascript, comparing type and value**|
108
-
| NEQ | does not equal | Returns true if operands are not equal, e.g. "A" NEQ "B" is true |
109
-
|\<\>| does not equal | Returns true if operands are not equal, e.g. "A" <> "B" is true |
110
-
| != | does not equal | Returns true if operands are not equal, e.g. "A" != "B" is true |
111
-
| !== | is not identical | Returns true if operands are not equal or not of the same type, e.g. 1 !== "1" is true, but 1 !== 1 is false |
112
-
| GT | greater than | Returns true if the operand on the left is has a higher value than the operand on the right, e.g. 1 GT 2 is false |
113
-
| > | greater than |Returns true if the operand on the left is has a higher value than the operand on the right, e.g. 1 > 2 is false |
114
-
| LT | less than | Returns true if the operand on the left has a lower value than the operand on the right, e.g. 1 LT 2 is true |
115
-
| < | less than | Returns true if the operand on the left has a lower value than the operand on the right, e.g. 1 < 2 is true |
116
-
| GTE | greater than or equal to | Returns true if the operand on the left has a value higher than or equal to the operand on the right, e.g. 2 GTE 2 is true |
117
-
| >= | greater than or equal to | Returns true if the operand on the left has a value higher than or equal to the operand on the right, e.g. 2 >= 2 is true |
118
-
| LTE | less than or equal to | Returns true if the operand on the left has a value lower than or equal to the operand on the right, e.g. 2 LTE 2 is true|
119
-
| <= | less than or equal to | Returns true if the operand on the left has a value lower than or equal to the operand on the right, e.g. 2 <= 2 is true |
120
-
| CONTAINS | contains | Returns true if the left operand contains the right operand, e.g. "SMILES" CONTAINS "MILE" is true |
121
-
| CT | contains | Returns true if the left operand contains the right operand, e.g. "SMILES" CT "MILE" is true |
122
-
| DOES NOT CONTAIN | does not contain | Returns true if the left operand does not contain the right operand, e.g. "SMILES" DOES NOT CONTAIN "RHUBARB" is true |
123
-
| NCT | does not contain | Returns true if the left operand does not contain the right operand, e.g. "SMILES" NCT "RHUBARB" is true |
105
+
| EQ | equals | Returns true if operands are equal, e.g. `"A" EQ "A"` is true |
106
+
| == | equals | Returns true if operands are equal, e.g. `"A" == "A"` is true |
107
+
| === | identical | Returns true if operands are the same object in memory, false if they are not, (Note this is different than how JavaScript's `===` operator works). **Lucee 6 === works like javascript, comparing type and value**|
108
+
| NEQ | does not equal | Returns true if operands are not equal, e.g. `"A" NEQ "B"` is true |
109
+
|\<\>| does not equal | Returns true if operands are not equal, e.g. `"A" <> "B"` is true |
110
+
| != | does not equal | Returns true if operands are not equal, e.g. `"A" != "B"` is true |
111
+
| !== | is not identical | Returns true if operands are not equal or not of the same type, e.g. `1 !== "1"` is true, but `1 !== 1` is false |
112
+
| GT | greater than | Returns true if the operand on the left is has a higher value than the operand on the right, e.g. `1 GT 2` is false |
113
+
| > | greater than |Returns true if the operand on the left is has a higher value than the operand on the right, e.g. `1 > 2` is false |
114
+
| LT | less than | Returns true if the operand on the left has a lower value than the operand on the right, e.g. `1 LT 2` is true |
115
+
| < | less than | Returns true if the operand on the left has a lower value than the operand on the right, e.g. `1 < 2` is true |
116
+
| GTE | greater than or equal to | Returns true if the operand on the left has a value higher than or equal to the operand on the right, e.g. `2 GTE 2` is true |
117
+
| >= | greater than or equal to | Returns true if the operand on the left has a value higher than or equal to the operand on the right, e.g. `2 >= 2` is true |
118
+
| LTE | less than or equal to | Returns true if the operand on the left has a value lower than or equal to the operand on the right, e.g. `2 LTE 2` is true|
119
+
| <= | less than or equal to | Returns true if the operand on the left has a value lower than or equal to the operand on the right, e.g. `2 <= 2` is true |
120
+
| CONTAINS | contains | Returns true if the left operand contains the right operand, e.g. `"SMILES" CONTAINS "MILE"` is true |
121
+
| CT | contains | Returns true if the left operand contains the right operand, e.g. `"SMILES" CT "MILE"` is true |
122
+
| DOES NOT CONTAIN | does not contain | Returns true if the left operand does not contain the right operand, e.g. `"SMILES" DOES NOT CONTAIN "RHUBARB"` is true |
123
+
| NCT | does not contain | Returns true if the left operand does not contain the right operand, e.g. `"SMILES" NCT "RHUBARB"` is true |
124
124
125
125
## String operators ##
126
126
127
127
| operators | Name | Description |
128
128
| --------- | -------------- | ----------- |
129
-
| & | concatenation | Joins two strings, e.g. The result of "Hello" & "World" is "HelloWorld" |
130
-
| &= | compound concatenation | A shorthand operator that joins two strings, e.g. a &= b would be equivalent to writing `a = a & b`|
129
+
| & | concatenation | Joins two strings, e.g. `The result of "Hello" & "World"` is "HelloWorld" |
130
+
| &= | compound concatenation | A shorthand operator that joins two strings, e.g. `a &= b` would be equivalent to writing `a = a & b`|
0 commit comments