Ejemplo n.º 1
0
        public static Rational operator+(double n, Rational rational)
        {
            Rational ret = new Rational(rational);

            ret.AddInplace(n);
            return(ret);
        }
Ejemplo n.º 2
0
        public static Rational operator+(Polynomial polynomial, Rational rational)
        {
            Rational ret = new Rational(rational);

            ret.AddInplace(polynomial);
            return(ret);
        }
        operator +(
            Rational rational,
            double n)
        {
            Rational ret = new Rational(rational);

            ret.AddInplace(n);
            return(ret);
        }
        operator +(
            Rational rational,
            Polynomial polynomial)
        {
            Rational ret = new Rational(rational);

            ret.AddInplace(polynomial);
            return(ret);
        }
        operator -(
            double n,
            Rational rational)
        {
            Rational ret = new Rational(rational);

            ret.NegateInplace();
            ret.AddInplace(n);
            return(ret);
        }
        operator -(
            Polynomial polynomial,
            Rational rational)
        {
            Rational ret = new Rational(rational);

            ret.NegateInplace();
            ret.AddInplace(polynomial);
            return(ret);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Subtract a rational from a real number.
 /// </summary>
 public static Rational operator -(
     double n,
     Rational rational)
 {
     Rational ret = new Rational(rational);
     ret.NegateInplace();
     ret.AddInplace(n);
     return ret;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Subtract a rational from a polynomial.
 /// </summary>
 public static Rational operator -(
     Polynomial polynomial,
     Rational rational)
 {
     Rational ret = new Rational(rational);
     ret.NegateInplace();
     ret.AddInplace(polynomial);
     return ret;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Add a real number to a rational.
 /// </summary>
 public static Rational operator +(
     Rational rational,
     double n)
 {
     Rational ret = new Rational(rational);
     ret.AddInplace(n);
     return ret;
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Add a polynomial to a rational.
 /// </summary>
 public static Rational operator +(
     Rational rational,
     Polynomial polynomial)
 {
     Rational ret = new Rational(rational);
     ret.AddInplace(polynomial);
     return ret;
 }
 operator +(
     double n,
     Rational rational
     )
 {
     Rational ret = new Rational(rational);
     ret.AddInplace(n);
     return ret;
 }
 operator +(
     Polynomial polynomial,
     Rational rational
     )
 {
     Rational ret = new Rational(rational);
     ret.AddInplace(polynomial);
     return ret;
 }