summaryrefslogtreecommitdiff
path: root/doc/script_commands.txt
diff options
context:
space:
mode:
authorgumi <mekolat@users.noreply.github.com>2017-05-17 15:24:58 -0400
committergumi <mekolat@users.noreply.github.com>2017-05-28 11:49:59 -0400
commit9e123cb8d22669e8e82571d6d31f993b3641028d (patch)
treefa68e47d5833765ccf49ff43e8a90e20ee80916d /doc/script_commands.txt
parentcb594e2deb23c810ea64f97f0513af5fc356bd38 (diff)
downloadhercules-9e123cb8d22669e8e82571d6d31f993b3641028d.tar.gz
hercules-9e123cb8d22669e8e82571d6d31f993b3641028d.tar.bz2
hercules-9e123cb8d22669e8e82571d6d31f993b3641028d.tar.xz
hercules-9e123cb8d22669e8e82571d6d31f993b3641028d.zip
update documentation for the exponentiation operator
Diffstat (limited to 'doc/script_commands.txt')
-rw-r--r--doc/script_commands.txt28
1 files changed, 16 insertions, 12 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 0ba350ad1..2ceb8696b 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -730,6 +730,7 @@ the common mathematical operations or conditional operators:
strings.
- - will subtract two numbers.
* - will multiply two numbers.
+** - will raise the first number to the power of the second number.
/ - will divide two numbers. Note that this is an integer division, i.e.
7/2 is not equal 3.5, it's equal 3.
% - will give you the remainder of the division. 7%2 is equal to 1.
@@ -930,42 +931,45 @@ Precedence | Description | Associativity
| ! Logical NOT |
| ~ Bitwise NOT (One's Complement) |
---------------------------------------------------------------------------
-3 | * Multiplication | Left to right
+3 | ** Exponentiation | Left to right
+---------------------------------------------------------------------------
+4 | * Multiplication | Left to right
| / Division |
| % Modulo (remainder) |
---------------------------------------------------------------------------
-4 | + Addition | Left to right
+5 | + Addition | Left to right
| - Subtraction |
---------------------------------------------------------------------------
-5 | << Bitwise left shift | Left to right
+6 | << Bitwise left shift | Left to right
| >> Bitwise right shift |
---------------------------------------------------------------------------
-6 | < Less than | Left to right
+7 | < Less than | Left to right
| <= Less than or equal to |
| > Greater than |
| >= Greater than or equal to |
---------------------------------------------------------------------------
-7 | == Equal to | Left to right
+8 | == Equal to | Left to right
| != Not equal to |
| ~= Regexp match |
| ~! Regexp non-match |
---------------------------------------------------------------------------
-8 | & Bitwise AND | Left to right
+9 | & Bitwise AND | Left to right
---------------------------------------------------------------------------
-9 | ^ Bitwise XOR (exclusive or) | Left to right
+10 | ^ Bitwise XOR (exclusive or) | Left to right
---------------------------------------------------------------------------
-10 | | Bitwise OR (inclusive or) | Left to right
+11 | | Bitwise OR (inclusive or) | Left to right
---------------------------------------------------------------------------
-11 | && Logical AND | Left to right
+12 | && Logical AND | Left to right
---------------------------------------------------------------------------
-12 | || Logical OR | Left to right
+13 | || Logical OR | Left to right
---------------------------------------------------------------------------
-13 | ?: Ternary conditional | Right to left
+14 | ?: Ternary conditional | Right to left
---------------------------------------------------------------------------
-14 | = Direct assignment | Right to left
+15 | = Direct assignment | Right to left
(lowest) | += Assignment by sum |
| -= Assignment by difference |
| *= Assignment by product |
+ | **= Assignment by power |
| /= Assignment by quotient |
| %= Assignment by remainder |
| <<= Assignment by bitwise left shift |