Esempio n. 1
0
		public static Fraction Multiply(Fraction fraction1, Fraction fraction2)
		{
			return fraction1 * fraction2;
		}
Esempio n. 2
0
		public static Fraction Add(Fraction fraction1, Fraction fraction2)
		{
			return fraction1 + fraction2;
		}
Esempio n. 3
0
		public static Fraction Subtract(Fraction fraction1, Fraction fraction2)
		{
			return fraction1 - fraction2;
		}
Esempio n. 4
0
 public static Fraction Divide(Fraction fraction1, Fraction fraction2)
 {
     return(fraction1 / fraction2);
 }
Esempio n. 5
0
 public static Fraction Modulus(Fraction fraction1, Fraction fraction2)
 {
     return(fraction1 % fraction2);
 }
Esempio n. 6
0
 public static Fraction Hypot(Fraction x1, Fraction y1)
 {
     return Complex64.Hypot((double)x1, (double)y1);
 }
Esempio n. 7
0
 public static Fraction Multiply(Fraction fraction1, Fraction fraction2)
 {
     return(fraction1 * fraction2);
 }
Esempio n. 8
0
 public FractionConstant(Fraction f)
 {
     value = f;
 }
Esempio n. 9
0
 public static Fraction Add(Fraction fraction1, Fraction fraction2)
 {
     return(fraction1 + fraction2);
 }
Esempio n. 10
0
 public ComplexFraction(Fraction real)
     : this(real, 0)
 {
 }
Esempio n. 11
0
 public ComplexFraction(Fraction real, Fraction imag)
 {
     this.real = real;
       this.imag = imag;
 }
Esempio n. 12
0
 public static ComplexFraction MakeReal(Fraction real)
 {
     return new ComplexFraction(real, 0);
 }
Esempio n. 13
0
 public static ComplexFraction MakeImaginary(Fraction imag)
 {
     return new ComplexFraction(0, imag);
 }
Esempio n. 14
0
 public static ComplexFraction Make(Fraction real, Fraction imag)
 {
     return new ComplexFraction(real, imag);
 }
Esempio n. 15
0
		public static Fraction Divide(Fraction fraction1, Fraction fraction2)
		{
			return fraction1 / fraction2;
		}
Esempio n. 16
0
 public static Fraction Subtract(Fraction fraction1, Fraction fraction2)
 {
     return(fraction1 - fraction2);
 }
Esempio n. 17
0
		public static Fraction Modulus(Fraction fraction1, Fraction fraction2)
		{
			return fraction1 % fraction2;
		}
Esempio n. 18
0
        public static ComplexFraction operator /(ComplexFraction a, ComplexFraction b)
        {
            if (b.IsZero) throw new DivideByZeroException();

              Fraction real, imag, den, r;

              if (b.real.Abs() >= b.imag.Abs())
              {
            r = b.imag / b.real;
            den = b.real + r * b.imag;
            real = (a.real + a.imag * r) / den;
            imag = (a.imag - a.real * r) / den;
              }
              else
              {
            r = b.real / b.imag;
            den = b.imag + r * b.real;
            real = (a.real * r + a.imag) / den;
            imag = (a.imag * r - a.real) / den;
              }

              return new ComplexFraction(real, imag);
        }