Exemple #1
0
        public static Complex operator /(Complex x, Complex y)
        {
            PromoteExactness(x, y, out x, out y);
            ComplexPart divisor = (y.Real * y.Real) + (y.Imag * y.Imag);
            var         newReal = ((x.Real * y.Real) + (x.Imag * y.Imag)) / divisor;
            var         newImag = ((x.Imag * y.Real) - (x.Real * y.Imag)) / divisor;

            return(new Complex(newReal, newImag, x.IsExact));
        }
Exemple #2
0
 public static Complex CreateInExact(ComplexPart a, ComplexPart b)
 {
     return(new Complex(a, b, false));
 }
Exemple #3
0
 public Complex(ComplexPart real, ComplexPart imag, bool isExact)
 {
     Real    = real;
     Imag    = imag;
     IsExact = isExact;
 }
Exemple #4
0
 public static Complex CreateInexactReal(double a)
 {
     return(new Complex(ComplexPart.CreateFromDouble(a), ComplexPart.Zero, false));
 }
Exemple #5
0
 public static Complex CreateExact(ComplexPart a, ComplexPart b)
 {
     return(new Complex(a, b, true));
 }