Ejemplo n.º 1
0
        /// <summary>
        /// Evaluate this parse tree node with the given variable values.
        /// </summary>
        /// <param name="variables">The variable values to use in calculation.</param>
        /// <returns>Returns the result of the evaluation.</returns>
        public override double Evaluate(VariableSet variables)
        {
            double leftResult  = Left.Evaluate(variables);
            double rightResult = Right.Evaluate(variables);

            return(Evaluator.Function(leftResult, rightResult));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Evaluate this parse tree node with the given variable values.
        /// </summary>
        /// <param name="variables">The variable values to use in calculation.</param>
        /// <returns>Returns the result of the evaluation.</returns>
        public override double Evaluate(VariableSet variables)
        {
            double operandResult = Operand.Evaluate(variables);

            return(Evaluator.Function(operandResult));
        }