Пример #1
0
        public int TermGCD()
        {
            int res = 0;

            foreach (var term in Terms)
            {
                res = CasSystem.GCD(res, term.Coefficient);
            }
            return(res);
        }
Пример #2
0
        public CasExpr Simplify()
        {
            int gcd = CasSystem.GCD(Poly1.TermGCD(), Poly2.TermGCD());

            if (gcd == 0 || gcd == 1)
            {
                return(this);
            }
            else
            {
                return(new CasExpr(Poly1.DivideTerms(gcd), Poly2.DivideTerms(gcd)));
            }
        }