void executeExponentialIntInt(Executer &executer) { auto y = executer.topInt(); executer.pop(); auto x = executer.topInt(); executer.setTop(PowerIntInt{executer, x, y}()); }
void executeSubtractIntInt(Executer &executer) { auto rhs = executer.topInt(); executer.pop(); auto result = int64_t{executer.topInt()}; result -= rhs; checkIntegerOverflow(executer, result); executer.setTopIntFromInt64(result); }
inline int32_t popIntegerDivisor(Executer &executer) { auto rhs = executer.topInt(); checkDivideByZero(executer, rhs); executer.pop(); return rhs; }
void executeRndInt(Executer &executer) { auto argument = executer.topInt(); if (argument <= 0) { throw RunError {"random function on zero or negative number", executer.currentOffset()}; } executer.setTop(executer.getRandomNumber(argument)); }
void executeAbsInt(Executer &executer) { auto argument = executer.topInt(); if (argument < 0) { checkNegativeIntegerOverflow(executer, argument); executer.setTop(-argument); } }
void executeImp(Executer &executer) { auto rhs = executer.topInt(); executer.pop(); executer.setTop(~executer.topInt() | rhs); }
void executeEqv(Executer &executer) { auto rhs = executer.topInt(); executer.pop(); executer.setTop(~(executer.topInt() ^ rhs)); }
void executeXor(Executer &executer) { auto rhs = executer.topInt(); executer.pop(); executer.setTop(executer.topInt() ^ rhs); }
void executeAnd(Executer &executer) { auto rhs = executer.topInt(); executer.pop(); executer.setTop(executer.topInt() & rhs); }
void executeModuloIntInt(Executer &executer) { auto rhs = popIntegerDivisor(executer); executer.setTop(executer.topInt() % rhs); }
void executeDivideIntInt(Executer &executer) { auto rhs = popIntegerDivisor(executer); executer.setTop(executer.topInt() / rhs); }
void executeNegateInt(Executer &executer) { auto operand = executer.topInt(); checkNegativeIntegerOverflow(executer, operand); executer.setTop(-operand); }