Example #1
0
        protected bool Equals(DecimalMonomial other)
        {
            if (other == null)
            {
                return(false);
            }

            return(this.Value == other.Value && this.Degree == other.Degree);
        }
Example #2
0
 public void Add(DecimalMonomial monomial)
 {
     if (monomial.Degree > this.Degree)
     {
         this.Polynomials.Add(monomial);
         this.Normalize();
     }
     else
     {
         this[monomial.Degree] = this[monomial.Degree] + monomial;
     }
 }
Example #3
0
 public DecimalPolynomial Multiply(DecimalMonomial monomial)
 {
     return(new DecimalPolynomial(this.Polynomials.Select(x => x * monomial).ToList()));
 }