예제 #1
0
    /// <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());
    }
예제 #2
0
 public override double GetValue()
 {
     if (m_arg1.GetValue() <= m_arg2.GetValue())
     {
         return(1);
     }
     else
     {
         return(0);
     }
 }
예제 #3
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());
        }
예제 #4
0
 /// <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);
 }
예제 #5
0
 public override double GetValue()
 {
     return(m_arg1.GetValue() - m_arg2.GetValue());
 }
예제 #6
0
 public override double GetValue()
 {
     return(Math.Pow(m_arg1.GetValue(), m_arg2.GetValue()));
 }