Пример #1
0
        public void CloneTest()
        {
            var exp   = new Csch(new Number(1));
            var clone = exp.Clone();

            Assert.Equal(exp, clone);
        }
Пример #2
0
        /// <summary>
        /// Analyzes the specified expression.
        /// </summary>
        /// <param name="exp">The expression.</param>
        /// <returns>
        /// The result of analysis.
        /// </returns>
        public override IExpression Analyze(Csch exp)
        {
            if (!Helpers.HasVariable(exp, Variable))
            {
                return(new Number(0));
            }

            var coth    = new Coth(exp.Argument.Clone());
            var mul1    = new Mul(coth, exp.Clone());
            var mul2    = new Mul(exp.Argument.Clone().Analyze(this), mul1);
            var unMinus = new UnaryMinus(mul2);

            return(unMinus);
        }