Exemple #1
0
        // static methods
        public static Monom <T> Multiply(Monom <T> first, Monom <T> second)
        {
            Monom <T> result = (Monom <T>)first.Clone();

            result.Multiply(second);
            return(result);
        }
Exemple #2
0
        public static Monom <T> Divide(Monom <T> first, Monom <T> second)
        {
            Monom <T> result = (Monom <T>)first.Clone();

            result.Divide(second);
            return(result);
        }
Exemple #3
0
        public static Monom <T> Negate(Monom <T> monom)
        {
            Monom <T> result = (Monom <T>)monom.Clone();

            result.InverseAdditive();
            return(result);
        }
Exemple #4
0
        // IComparable
        public int CompareTo(Monom <T> other)
        {
            int compareRes = Degree.CompareTo(other.Degree);

            if (compareRes != 0)
            {
                return(compareRes);
            }
            return(Coef.CompareTo(other.Coef));
        }
Exemple #5
0
 public void Divide(Monom <T> another)
 {
     Coef.Divide(another.Coef);
     Degree -= another.Degree;
 }
Exemple #6
0
 public void Multiply(Monom <T> another)
 {
     Coef.Multiply(another.Coef);
     Degree += another.Degree;
 }
Exemple #7
0
 int IComparable <Monom <T> > .CompareTo(Monom <T> other) => CompareTo(other);