System.Numerics.Tests.ComplexTests.Add C# (CSharp) Метод

Add() приватный Метод

private Add ( double realLeft, double imaginaryLeft, double realRight, double imaginaryRight ) : void
realLeft double
imaginaryLeft double
realRight double
imaginaryRight double
Результат void
        public static void Add(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.Add(left, right);
            VerifyRealImaginaryProperties(result, expectedReal, expectedImaginary);
        }
ComplexTests