diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-11-23 12:23:45 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-11-23 12:23:45 -0200 |
commit | 84e32ad2ebd6bd160c1320456743a5b1d8f233e9 (patch) | |
tree | c5a32eaf7577c99e7598e9de1385a6b53522f04b /testes/db.lua | |
parent | 35296e1fde705b3ac8356a4f4ce426497cf7b64c (diff) | |
download | lua-84e32ad2ebd6bd160c1320456743a5b1d8f233e9.tar.gz lua-84e32ad2ebd6bd160c1320456743a5b1d8f233e9.tar.bz2 lua-84e32ad2ebd6bd160c1320456743a5b1d8f233e9.zip |
Added opcodes for arithmetic with K operands
Added opcodes for all seven arithmetic operators with K operands
(that is, operands that are numbers in the array of constants of
the function). They cover the cases of constant float operands
(e.g., 'x + .0.0', 'x^0.5') and large integer operands (e.g.,
'x % 10000').
Diffstat (limited to 'testes/db.lua')
-rw-r--r-- | testes/db.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/testes/db.lua b/testes/db.lua index 9da68210..5b243c39 100644 --- a/testes/db.lua +++ b/testes/db.lua | |||
@@ -794,6 +794,8 @@ assert(a[3] == "index" and a^3 == "pow" and a..a == "concat") | |||
794 | assert(a/3 == "div" and 3%a == "mod") | 794 | assert(a/3 == "div" and 3%a == "mod") |
795 | assert(a+3 == "add" and 3-a == "sub" and a*3 == "mul" and | 795 | assert(a+3 == "add" and 3-a == "sub" and a*3 == "mul" and |
796 | -a == "unm" and #a == "len" and a&3 == "band") | 796 | -a == "unm" and #a == "len" and a&3 == "band") |
797 | assert(a + 30000 == "add" and a - 3.0 == "sub" and a * 3.0 == "mul" and | ||
798 | -a == "unm" and #a == "len" and a & 3 == "band") | ||
797 | assert(a|3 == "bor" and 3~a == "bxor" and a<<3 == "shift" and | 799 | assert(a|3 == "bor" and 3~a == "bxor" and a<<3 == "shift" and |
798 | a>>1 == "shift") | 800 | a>>1 == "shift") |
799 | assert (a==b and a.op == "eq") | 801 | assert (a==b and a.op == "eq") |