예제 #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));
        }
예제 #2
0
 public static Complex CreateInExact(ComplexPart a, ComplexPart b)
 {
     return(new Complex(a, b, false));
 }
예제 #3
0
 public Complex(ComplexPart real, ComplexPart imag, bool isExact)
 {
     Real    = real;
     Imag    = imag;
     IsExact = isExact;
 }
예제 #4
0
 public static Complex CreateInexactReal(double a)
 {
     return(new Complex(ComplexPart.CreateFromDouble(a), ComplexPart.Zero, false));
 }
예제 #5
0
 public static Complex CreateExact(ComplexPart a, ComplexPart b)
 {
     return(new Complex(a, b, true));
 }