当前位置: 首页>>代码示例>>C++>>正文


C++ Evaluator::pop方法代码示例

本文整理汇总了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);
	}
开发者ID:xavierholt,项目名称:RPN,代码行数:11,代码来源:cosecant.cpp

示例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);
	}
开发者ID:xavierholt,项目名称:RPN,代码行数:11,代码来源:root.cpp

示例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);
	}
开发者ID:xavierholt,项目名称:RPN,代码行数:11,代码来源:tangent.cpp

示例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);
	}
开发者ID:xavierholt,项目名称:RPN,代码行数:11,代码来源:sine.cpp

示例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);
	}
开发者ID:xavierholt,项目名称:RPN,代码行数:10,代码来源:decadiclogarithm.cpp

示例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));
	}
开发者ID:xavierholt,项目名称:RPN,代码行数:11,代码来源:arccosecant.cpp

示例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);
	}
开发者ID:xavierholt,项目名称:RPN,代码行数:10,代码来源:absolutevalue.cpp


注:本文中的Evaluator::pop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。