/// <summary> /// Calculate(): Calls into the runnable function set to evaluate the function and returns the result. /// </summary> /// <returns>double value evaluation of the function in its current state</returns> public double Calculate() { if (m_Function == null) { Compile(); } return(m_Function.GetValue()); }
public override double GetValue() { if (m_arg1.GetValue() <= m_arg2.GetValue()) { return(1); } else { return(0); } }
/// <summary> /// Evaluates the function and returns the result. /// </summary> /// <returns>double value evaluation of the function in its current state</returns> public double Calculate() { if (_function == null) { Compile(); } if (_nextToken != null) { throw new InvalidEquationException("Invalid token found in equation: " + _currentToken.ToString()); } return(_function.GetValue()); }
/// <summary> /// GetValue(): Performs the negative operation on the child operation and returns the value. /// </summary> /// <returns>A double value evaluated and returned with the opposite sign.</returns> public override double GetValue() { return(m_oValue.GetValue() * -1); }
public override double GetValue() { return(m_arg1.GetValue() - m_arg2.GetValue()); }
public override double GetValue() { return(Math.Pow(m_arg1.GetValue(), m_arg2.GetValue())); }