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