示例#1
0
        public void Test_numerics_7()
        {
            var expr1 = new CompositeExpr(WellKnownSym.plus,
                new Expr[] { new IntegerNumber("16"), new IntegerNumber("9") });
            var expr2 = new CompositeExpr(WellKnownSym.root,
                new Expr[] { new IntegerNumber("2"), expr1 });
            var expr3 = new CompositeExpr(WellKnownSym.equals,
                new Expr[] { new LetterSym('d'), expr2 });

            object obj;
            bool result = expr2.IsExpression(out obj);
            Assert.True(result);
            var gTerm = obj as Term;
            Assert.NotNull(gTerm);

            result = expr3.IsEquation(out obj);
            Assert.True(result);
            var gEquation = obj as Equation;
            Assert.NotNull(gEquation);
        }
示例#2
0
        public void Test_numerics_8()
        {
            var expr1 = new CompositeExpr(WellKnownSym.divide,
                new Expr[] { new DoubleNumber(0.5) });

            var expr2 = new CompositeExpr(WellKnownSym.times,
                new Expr[] { -1, expr1 });

            object obj;
            bool result = expr2.IsExpression(out obj);
            Assert.True(result);
        }
示例#3
0
        public void Test_5()
        {
            var expr0 = new CompositeExpr(WellKnownSym.times,
                new Expr[] { new LetterSym('m'), new IntegerNumber(1) });

            var expr11 = new CompositeExpr(WellKnownSym.divide,
                new Expr[] { 0.5 });

            var expr1 = new CompositeExpr(WellKnownSym.times,
                new Expr[] { -1, expr11 });
            var expr2 = new CompositeExpr(WellKnownSym.equals,
                new Expr[] { expr0, expr1 });

            object obj;
            bool result = expr0.IsExpression(out obj);
            Assert.True(result);

            result = expr2.IsEquationLabel(out obj);
            Assert.True(result);
        }