summaryrefslogtreecommitdiff
path: root/npc/dev
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-06-03 17:36:58 +0200
committerGitHub <noreply@github.com>2017-06-03 17:36:58 +0200
commit0a4abf01c3b3c41ce169752cd3d6d74766d1eee1 (patch)
tree50dcdf0d6f5d29664ff90efa280aec7fbd1fa925 /npc/dev
parentd2af893049845c4be0710f8939d09ba87485dddc (diff)
parent392c4b225dfc99401faeef882b10ce0b6d6a2209 (diff)
downloadhercules-0a4abf01c3b3c41ce169752cd3d6d74766d1eee1.tar.gz
hercules-0a4abf01c3b3c41ce169752cd3d6d74766d1eee1.tar.bz2
hercules-0a4abf01c3b3c41ce169752cd3d6d74766d1eee1.tar.xz
hercules-0a4abf01c3b3c41ce169752cd3d6d74766d1eee1.zip
Merge pull request #1739 from mekolat/pow2
implementation of the exponentiation operator
Diffstat (limited to 'npc/dev')
-rw-r--r--npc/dev/test.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/npc/dev/test.txt b/npc/dev/test.txt
index b711a0a28..b35beb8ed 100644
--- a/npc/dev/test.txt
+++ b/npc/dev/test.txt
@@ -268,6 +268,19 @@ function script HerculesSelfTestHelper {
callsub(OnCheck, "Order of + and *", .@x, 7);
+ // Binary ** operator
+ .@x = 2 ** 3; // .@x = 8;
+ callsub(OnCheck, "Binary ** operator", .@x, 8);
+
+ // Associativity of **
+ .@x = 2 ** 3 ** 2; // .@x = (2 ** 3) ** 2;
+ callsub(OnCheck, "Associativity of **", .@x, 64);
+
+ // Order of ** and *
+ .@x = 5 * 2 ** 3 * 2; // .@x = 5 * (2 ** 3) * 2;
+ callsub(OnCheck, "Order of ** and *", .@x, 80);
+
+
// << and >> operators
.@x = 1<<3; // .@x = 1*2*2*2;
callsub(OnCheck, "Left shift << operator", .@x, 8);