本文整理汇总了C++中Executer::topDbl方法的典型用法代码示例。如果您正苦于以下问题:C++ Executer::topDbl方法的具体用法?C++ Executer::topDbl怎么用?C++ Executer::topDbl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Executer
的用法示例。
在下文中一共展示了Executer::topDbl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: executeExponentialDblDbl
void executeExponentialDblDbl(Executer &executer)
{
auto y = executer.topDbl();
executer.pop();
auto x = executer.topDbl();
calculatePowerDblDbl(executer, x, y);
}
示例2: executeSubtractDblDbl
void executeSubtractDblDbl(Executer &executer)
{
auto rhs = executer.topDbl();
executer.pop();
auto result = executer.topDbl() - rhs;
checkDoubleOverflow(executer, result);
executer.setTop(result);
}
示例3: executeDivideDblInt
void executeDivideDblInt(Executer &executer)
{
auto rhs = static_cast<double>(popIntegerDivisor(executer));
auto lhs = executer.topDbl();
auto result = lhs / rhs;
executer.setTop(result);
}
示例4: popDoubleDivisor
inline double popDoubleDivisor(Executer &executer)
{
auto rhs = executer.topDbl();
checkDivideByZero(executer, rhs);
executer.pop();
return rhs;
}
示例5: executeMultiplyIntDbl
void executeMultiplyIntDbl(Executer &executer)
{
auto rhs = executer.topDbl();
executer.pop();
auto lhs = executer.topIntAsDbl();
multiplyAndCheckResult(executer, lhs, rhs);
}
示例6: executeExponentialDblInt
void executeExponentialDblInt(Executer &executer)
{
auto y = executer.topInt();
executer.pop();
auto x = executer.topDbl();
executer.setTop(PowerDblInt{executer, x, y}());
}
示例7: executeAbsDbl
void executeAbsDbl(Executer &executer)
{
auto argument = executer.topDbl();
if (argument < 0) {
executer.setTop(-argument);
}
}
示例8: executeIntegerDivide
void executeIntegerDivide(Executer &executer)
{
auto rhs = popDoubleDivisor(executer);
auto lhs = executer.topDbl();
auto result = lhs / rhs;
checkIntegerOverflow(executer, result);
executer.setTopIntFromDouble(result);
}
示例9: executeSqr
void executeSqr(Executer &executer)
{
auto argument = executer.topDbl();
if (argument < 0) {
throw RunError {"square root of negative number", executer.currentOffset()};
}
executer.setTop(std::sqrt(argument));
}
示例10: executeLog
void executeLog(Executer &executer)
{
auto argument = executer.topDbl();
if (argument <= 0) {
throw RunError {"logarithm of non-positive number", executer.currentOffset()};
}
executer.setTop(std::log(argument));
}
示例11: executeSubtractDblInt
void executeSubtractDblInt(Executer &executer)
{
auto rhs = executer.topIntAsDbl();
executer.pop();
executer.setTop(executer.topDbl() - rhs);
}
示例12: executeCvtInt
void executeCvtInt(Executer &executer)
{
auto operand = std::round(executer.topDbl());
checkIntegerOverflow(executer, operand);
executer.setTopIntFromDouble(operand);
}
示例13: executeExp
void executeExp(Executer &executer)
{
auto result = std::exp(executer.topDbl());
checkForOverflow(executer, result);
executer.setTop(result);
}
示例14: doDoubleMultiply
inline void doDoubleMultiply(Executer &executer, double rhs)
{
executer.pop();
auto lhs = executer.topDbl();
multiplyAndCheckResult(executer, lhs, rhs);
}
示例15: executeAtn
void executeAtn(Executer &executer)
{
executer.setTop(std::atan(executer.topDbl()));
}