示例#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);
        }
示例#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);
        }
示例#3
0
        public static Monom <T> Negate(Monom <T> monom)
        {
            Monom <T> result = (Monom <T>)monom.Clone();

            result.InverseAdditive();
            return(result);
        }
示例#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));
        }
示例#5
0
 public void Divide(Monom <T> another)
 {
     Coef.Divide(another.Coef);
     Degree -= another.Degree;
 }
示例#6
0
 public void Multiply(Monom <T> another)
 {
     Coef.Multiply(another.Coef);
     Degree += another.Degree;
 }
示例#7
0
 int IComparable <Monom <T> > .CompareTo(Monom <T> other) => CompareTo(other);