System.Numerics.Tests.ComplexTests.Subtract C# (CSharp) Method

Subtract() private method

private Subtract ( double realLeft, double imaginaryLeft, double realRight, double imaginaryRight ) : void
realLeft double
imaginaryLeft double
realRight double
imaginaryRight double
return void
        public static void Subtract(double realLeft, double imaginaryLeft, double realRight, double imaginaryRight)
        {
            var left = new Complex(realLeft, imaginaryLeft);
            var right = new Complex(realRight, imaginaryRight);

            // calculate the expected results
            double expectedReal = realLeft - realRight;
            double expectedImaginary = imaginaryLeft - imaginaryRight;

            // Operator
            Complex result = left - right;
            VerifyRealImaginaryProperties(result, expectedReal, expectedImaginary);

            // Static method
            result = Complex.Subtract(left, right);
            VerifyRealImaginaryProperties(result, expectedReal, expectedImaginary);
        }
ComplexTests