mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
adding operator fo vm
This commit is contained in:
parent
1371aa98c1
commit
591d96ebbe
12
src/PikaVM.c
12
src/PikaVM.c
@ -209,6 +209,18 @@ Arg* pikaVM_runInstruct(PikaObj* self,
|
|||||||
outArg = arg_setInt(outArg, "", num1 / num2);
|
outArg = arg_setInt(outArg, "", num1 / num2);
|
||||||
goto OPT_exit;
|
goto OPT_exit;
|
||||||
}
|
}
|
||||||
|
if (strEqu("%", data)) {
|
||||||
|
outArg = arg_setInt(outArg, "", num1 % num2);
|
||||||
|
goto OPT_exit;
|
||||||
|
}
|
||||||
|
if (strEqu("**", data)) {
|
||||||
|
int res = 1;
|
||||||
|
for (int i = 0; i < num2; i++) {
|
||||||
|
res *= num1;
|
||||||
|
}
|
||||||
|
outArg = arg_setInt(outArg, "", res);
|
||||||
|
goto OPT_exit;
|
||||||
|
}
|
||||||
if (strEqu("<", data)) {
|
if (strEqu("<", data)) {
|
||||||
outArg = arg_setInt(outArg, "", num1 < num2);
|
outArg = arg_setInt(outArg, "", num1 < num2);
|
||||||
goto OPT_exit;
|
goto OPT_exit;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user