aboutsummaryrefslogtreecommitdiff
path: root/vm.d
diff options
context:
space:
mode:
authormryouse2023-05-27 01:23:03 +0000
committermryouse2023-05-27 01:23:03 +0000
commitd21a835072674939527ee327cb34049c072d7e75 (patch)
tree1c8eaa0fdd317fb1d18ea51eacad1c0737639bc3 /vm.d
parent21eff156a3094c82ad85f8d3658fc1ac79c63da1 (diff)
division
Diffstat (limited to 'vm.d')
-rw-r--r--vm.d7
1 files changed, 7 insertions, 0 deletions
diff --git a/vm.d b/vm.d
index a865a50..d4fab80 100644
--- a/vm.d
+++ b/vm.d
@@ -507,6 +507,13 @@ class VM {
double anum = asNumber(a);
this.pushA(makeNumberValue(anum * bnum));
break;
+ case OpCode.OP_DIVIDE:
+ Value b = this.popA();
+ Value a = this.popA();
+ double bnum = asNumber(b);
+ double anum = asNumber(a);
+ this.pushA(makeNumberValue(anum / bnum));
+ break;
case OpCode.OP_NOT:
Value val = this.popA();
bool bval = asBoolean(val);