Пример #1
0
        public static Rational operator*(double n, Rational rational)
        {
            Rational ret = new Rational(rational);

            ret.MultiplyInplace(n);
            return(ret);
        }
        operator *(
            Rational rational,
            double n)
        {
            Rational ret = new Rational(rational);

            ret.MultiplyInplace(n);
            return(ret);
        }
        operator /(
            double n,
            Rational rational)
        {
            Rational ret = new Rational(rational);

            ret.InvertInplace();
            ret.MultiplyInplace(n);
            return(ret);
        }
Пример #4
0
 /// <summary>
 /// Stretch a the inverse of a rational with a real number quotient.
 /// </summary>
 public static Rational operator /(
     double n,
     Rational rational)
 {
     Rational ret = new Rational(rational);
     ret.InvertInplace();
     ret.MultiplyInplace(n);
     return ret;
 }
Пример #5
0
 /// <summary>
 /// Stretch a rational with a real number factor.
 /// </summary>
 public static Rational operator *(
     Rational rational,
     double n)
 {
     Rational ret = new Rational(rational);
     ret.MultiplyInplace(n);
     return ret;
 }
 operator *(
     double n,
     Rational rational
     )
 {
     Rational ret = new Rational(rational);
     ret.MultiplyInplace(n);
     return ret;
 }