Пример #1
0
 private void BtnMinus_Click(object sender, EventArgs e)
 {
     if (ValidateInputs())
     {
         int minus = mycalc.Minus((int)txtNumber1.Value, (int)txtNumber2.Value);
         MessageBox.Show("حاصل تفریق = " + minus);
     }
 }
Пример #2
0
        public static Polynom <T> operator -(Polynom <T> A, Polynom <T> B)
        {
            if (A == null || B == null)
            {
                return(null);
            }
            var res = new Polynom <T>(_calculator);

            foreach (Monom <T> i in A)
            {
                res.Add(i);
            }
            foreach (Monom <T> i in B)
            {
                T         minus = _calculator.Minus(i.coef);
                Monom <T> monom;
                monom.coef = minus;
                monom.pow  = i.pow;
                res.Add(monom);
            }
            return(res);
        }