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').
This commit is contained in:
@@ -144,6 +144,8 @@ t.__bnot = f("bnot")
|
||||
-- when the constant table is very small.
|
||||
assert(b+5 == b)
|
||||
assert(cap[0] == "add" and cap[1] == b and cap[2] == 5 and cap[3]==undef)
|
||||
assert(5.2 + b == 5.2)
|
||||
assert(cap[0] == "add" and cap[1] == 5.2 and cap[2] == b and cap[3]==undef)
|
||||
assert(b+'5' == b)
|
||||
assert(cap[0] == "add" and cap[1] == b and cap[2] == '5' and cap[3]==undef)
|
||||
assert(5+b == 5)
|
||||
|
||||
Reference in New Issue
Block a user