本文整理汇总了C++中Evaluator::pop方法的典型用法代码示例。如果您正苦于以下问题:C++ Evaluator::pop方法的具体用法?C++ Evaluator::pop怎么用?C++ Evaluator::pop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Evaluator
的用法示例。
在下文中一共展示了Evaluator::pop方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: evaluate
/**
* Pops a value off the stack and returns its hyperbolic cosecant.
* @param evaluator The current evaluation.
* @return The hyperbolic cosecant of the popped node.
*/
double HyperbolicCosecantNode::evaluate(Evaluator& evaluator) const
{
double arg = evaluator.pop();
double ex = exp(arg);
return (2 * ex) / (ex * ex - 1);
}
示例2: evaluate
/**
* Pops two values off the stack and returns the first raised to the power of the reciprocal of the second.
* @param evaluator The current evaluation.
* @return The second value'th root of the first popped value.
*/
double RootNode::evaluate(Evaluator& evaluator) const
{
double arg2 = evaluator.pop();
double arg1 = evaluator.pop();
return pow(arg1, 1.0 / arg2);
}
示例3: evaluate
/**
* Pops a value off the stack and returns its hyperbolic tangent.
* @param evaluator The current evaluation.
* @return The hyperbolic tangent of the popped node.
*/
double HyperbolicTangentNode::evaluate(Evaluator& evaluator) const
{
double arg = evaluator.pop();
double ex = exp(2 * arg);
return (ex - 1) / (ex + 1);
}
示例4: evaluate
/**
* Pops a value off the stack and returns its hyperbolic sine.
* @param evaluator The current evaluation.
* @return The hyperbolic sine of the popped node.
*/
double HyperbolicSineNode::evaluate(Evaluator& evaluator) const
{
double arg = evaluator.pop();
double ex = exp(arg);
return (ex * ex - 1) / (2 * ex);
}
示例5: evaluate
/**
* Pops a value off the stack and returns its decadic logarithm.
* @param evaluator The current evaluation.
* @return The decadic logarithm of the popped value.
*/
double DecadicLogarithmNode::evaluate(Evaluator& evaluator) const
{
double arg = evaluator.pop();
return log10(arg);
}
示例6: evaluate
/**
* Pops a value off the stack and returns its hyperbolic arc cosecant.
* @param evaluator The current evaluation.
* @return The hyperbolic arc cosecant of the popped node.
*/
double HyperbolicArcCosecantNode::evaluate(Evaluator& evaluator) const
{
double arg = evaluator.pop();
double inv = 1.0 / arg;
return log(inv + sqrt(inv * inv + 1));
}
示例7: evaluate
/**
* Pops a value off the stack and returns its absolute value.
* @param evaluator The current evaluation.
* @return The absolute value of the popped node.
*/
double AbsoluteValueNode::evaluate(Evaluator& evaluator) const
{
double arg = evaluator.pop();
return fabs(arg);
}