1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 11:13:12 +02:00

core: add power operator "**" in calc expressions (issue #997)

This commit is contained in:
Sébastien Helleu
2019-09-24 21:03:56 +02:00
parent 7d795c4d53
commit 3a356f109f
26 changed files with 166 additions and 136 deletions
+12
View File
@@ -108,6 +108,18 @@ TEST(CoreCalc, Expression)
WEE_CHECK_CALC("-2", "-2%4");
WEE_CHECK_CALC("0", "-2%2");
/* power */
WEE_CHECK_CALC("1", "0**0");
WEE_CHECK_CALC("0", "0**1");
WEE_CHECK_CALC("1", "1**0");
WEE_CHECK_CALC("1", "2**0");
WEE_CHECK_CALC("2", "2**1");
WEE_CHECK_CALC("4", "2**2");
WEE_CHECK_CALC("8", "2**3");
WEE_CHECK_CALC("4294967296", "2**32");
WEE_CHECK_CALC("0.5", "2**-1");
WEE_CHECK_CALC("0.25", "2**-2");
/* multiple operators */
WEE_CHECK_CALC("11", "5+2*3");