Exemple #1
0
        /// <summary>
        /// Analyzes the specified expression.
        /// </summary>
        /// <param name="exp">The expression.</param>
        /// <returns>
        /// The result of analysis.
        /// </returns>
        public override IExpression Analyze(Sqrt exp)
        {
            if (!Helpers.HasVariable(exp, Variable))
            {
                return(new Number(0));
            }

            var mul = new Mul(new Number(2), exp.Clone());
            var div = new Div(exp.Argument.Clone().Analyze(this), mul);

            return(div);
        }