From c33d2627d7db19bee74b35c7b64000ed06cba8d4 Mon Sep 17 00:00:00 2001 From: carlossanlop Date: Thu, 1 Aug 2019 15:03:18 -0700 Subject: [PATCH 01/10] Document System.Numerics APIs: op_Addition, op_Division, op_Multiply, op_Substraction, Substract --- xml/System.Numerics/Complex.xml | 376 +++++++++++++++++++------------- 1 file changed, 224 insertions(+), 152 deletions(-) diff --git a/xml/System.Numerics/Complex.xml b/xml/System.Numerics/Complex.xml index dabce831640..90bd6ef99b5 100644 --- a/xml/System.Numerics/Complex.xml +++ b/xml/System.Numerics/Complex.xml @@ -1832,6 +1832,45 @@ + + + System.Runtime.Numerics + 4.1.1.0 + + + Adds a specified number to another specified number. + + + method defines the addition operation for complex numbers. It enables code such as the following: + +[!code-csharp[System.Numerics.Complex.Add#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.add/cs/add3.cs#3)] +[!code-vb[System.Numerics.Complex.Add#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.add/vb/add3.vb#3)] + +The addition of a complex number, a + bi, and a second complex number, c + di, takes the following form: + +(a + c) + (b + d)i + +If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . + +Languages that do not support custom operators can call the method instead. + +The equivalent method for this operator is . + +## Examples + +The following example illustrates addition with complex numbers. + +[!code-csharp[System.Numerics.Complex.Add#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.add/cs/add2.cs#2)] +[!code-vb[System.Numerics.Complex.Add#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.add/vb/add2.vb#2)] + + ]]> + + + @@ -1858,11 +1897,12 @@ - To be added. - To be added. - To be added. - To be added. + The double value to add. + The complex value to add. + Adds a double number to a complex number. + The sum of and as a complex number. To be added. + @@ -1891,11 +1931,12 @@ - To be added. - To be added. - To be added. - To be added. + The complex value to add. + The double value to add. + Adds a complex number to a double number. + The sum of and as a complex number. To be added. + @@ -1930,40 +1971,45 @@ - The first value to add. - The second value to add. + The first complex value to add. + The second complex value to add. Adds two complex numbers. The sum of and . - - method defines the addition operation for complex numbers. It enables code such as the following: - - [!code-csharp[System.Numerics.Complex.Add#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.add/cs/add3.cs#3)] - [!code-vb[System.Numerics.Complex.Add#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.add/vb/add3.vb#3)] - - The addition of a complex number, a + bi, and a second complex number, c + di, takes the following form: - - (a + c) + (b + d)i - - If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . - - Languages that do not support custom operators can call the method instead. - - The equivalent method for this operator is - -## Examples - The following example illustrates addition with complex numbers. - - [!code-csharp[System.Numerics.Complex.Add#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.add/cs/add2.cs#2)] - [!code-vb[System.Numerics.Complex.Add#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.add/vb/add2.vb#2)] - - ]]> - + To be added. + + + System.Runtime.Numerics + 4.1.1.0 + + + Divides a specified number by another specified number. + + method defines the division operation for complex numbers. It enables code such as the following: + +[!code-csharp[System.Numerics.Complex.Divide#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.divide/cs/divide2.cs#2)] +[!code-vb[System.Numerics.Complex.Divide#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.divide/vb/divide2.vb#2)] + +The division of a complex number, a + bi, and a second complex number, c + di, takes the following form: + +((ac + bd) / (c2 + d2)) + ((bc - ad) / (c2 + d2)i + +If the division results in an overflow in either the real or imaginary component, the value of that component is either or . + +Languages that do not support custom operators and operator overloading can call the method instead. + +The equivalent method for this operator is . + + ]]> + + + @@ -1990,11 +2036,12 @@ - To be added. - To be added. - To be added. - To be added. + The double value to be divided. + The complex value to divide by. + Divides a specified double number by a specified complex number. + The result of dividing by , as a complex number. To be added. + @@ -2023,11 +2070,12 @@ - To be added. - To be added. - To be added. - To be added. + The complex value to be divided. + The double value to divide by. + Divides a specified complex number by a specified double number. + The result of dividing by , as a complex number. To be added. + @@ -2062,29 +2110,11 @@ - The value to be divided. - The value to divide by. + The complex value to be divided. + The complex value to divide by. Divides a specified complex number by another specified complex number. The result of dividing by . - - method defines the division operation for complex numbers. It enables code such as the following: - - [!code-csharp[System.Numerics.Complex.Divide#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.divide/cs/divide2.cs#2)] - [!code-vb[System.Numerics.Complex.Divide#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.divide/vb/divide2.vb#2)] - - The division of a complex number, a + bi, and a second complex number, c + di, takes the following form: - - ((ac + bd) / (c2 + d2)) + ((bc - ad) / (c2 + d2)i - - If the division results in an overflow in either the real or imaginary component, the value of that component is either or . - - Languages that do not support custom operators and operator overloading can call the method instead. - - The equivalent method for this operator is ]]> - + To be added. @@ -2851,6 +2881,37 @@ This API is not CLS-compliant. + + + System.Runtime.Numerics + 4.1.1.0 + + + Multiplies a specified number by another specified number. + + method defines the operation of the multiplication operator for complex numbers. It enables code such as the following: + +[!code-csharp[System.Numerics.Complex.Multiply#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.multiply/cs/multiply2.cs#2)] +[!code-vb[System.Numerics.Complex.Multiply#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.multiply/vb/multiply2.vb#2)] + +The multiplication of a complex number, a + bi, and a second complex number, c + di, takes the following form: + +(ac - bd) + (ad + bc)i + +If the multiplication results in an overflow in either the real or imaginary component, the value of that component is either or . + +Languages that do not support custom operators can call the method instead. + +The equivalent method for this operator is ]]>. + + + + + @@ -2877,11 +2938,12 @@ This API is not CLS-compliant. - To be added. - To be added. - To be added. - To be added. + The double value to multiply. + The complex value to multiply. + Multiplies a specified double number by a specified complex number. + The product of and , as a complex number. To be added. + @@ -2910,11 +2972,12 @@ This API is not CLS-compliant. - To be added. - To be added. - To be added. - To be added. + The complex value to multiply. + The double value to multiply. + Multiplies specified complex number by a specified double number. + The product of and , as a complex number. To be added. + @@ -2949,32 +3012,45 @@ This API is not CLS-compliant. - The first value to multiply. - The second value to multiply. + The first complex value to multiply. + The second complex value to multiply. Multiplies two specified complex numbers. The product of and . - - method defines the operation of the multiplication operator for complex numbers. It enables code such as the following: - - [!code-csharp[System.Numerics.Complex.Multiply#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.multiply/cs/multiply2.cs#2)] - [!code-vb[System.Numerics.Complex.Multiply#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.multiply/vb/multiply2.vb#2)] - - The multiplication of a complex number, a + bi, and a second complex number, c + di, takes the following form: - - (ac - bd) + (ad + bc)i - - If the multiplication results in an overflow in either the real or imaginary component, the value of that component is either or . - - Languages that do not support custom operators can call the method instead. - - The equivalent method for this operator is ]]> - + To be added. + + + System.Runtime.Numerics + 4.1.1.0 + + + Substracts a specified number from another specified number. + + method defines the operation of the subtraction operator for complex numbers. It enables code such as the following: + +[!code-csharp[System.Numerics.Complex.Subtract#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.subtract/cs/subtract2.cs#2)] +[!code-vb[System.Numerics.Complex.Subtract#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.subtract/vb/subtract2.vb#2)] + +If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . + +The subtraction of a complex number, c + di, from another complex number, a + bi, takes the following form: + +(a - c) + (b - d)i + +Languages that do not support custom operators can call the method instead. + +The equivalent method for this operator is . + + ]]> + + + @@ -3001,11 +3077,12 @@ This API is not CLS-compliant. - To be added. - To be added. - To be added. - To be added. + The double value to subtract from (the minuend). + The complex value to subtract (the subtrahend). + Subtracts a complex number from a double number. + The result of subtracting from , as a complex number. To be added. + @@ -3034,11 +3111,12 @@ This API is not CLS-compliant. - To be added. - To be added. - To be added. - To be added. + The complex value to subtract from (the minuend). + The double value to subtract (the subtrahend). + Subtracts a double number from a complex number. + The result of subtracting from , as a complex number. To be added. + @@ -3077,25 +3155,7 @@ This API is not CLS-compliant. The value to subtract (the subtrahend). Subtracts a complex number from another complex number. The result of subtracting from . - - method defines the operation of the subtraction operator for complex numbers. It enables code such as the following: - - [!code-csharp[System.Numerics.Complex.Subtract#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.subtract/cs/subtract2.cs#2)] - [!code-vb[System.Numerics.Complex.Subtract#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.subtract/vb/subtract2.vb#2)] - - If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . - - The subtraction of a complex number, c + di, from another complex number, a + bi, takes the following form: - - (a - c) + (b - d)i - - Languages that do not support custom operators can call the method instead. - - The equivalent method for this operator is ]]> - + To be added. @@ -3572,6 +3632,37 @@ This API is not CLS-compliant. + + + System.Runtime.Numerics + 4.1.1.0 + + + Substracts a specified number from another specified number and returns the result. + + or . + +Languages that do not support custom operators can use the method to perform subtraction using complex numbers. + +## Examples + +The following example subtracts each complex number in an array from a complex number. + +[!code-csharp[System.Numerics.Complex.Subtract#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.subtract/cs/subtract1.cs#1)] +[!code-vb[System.Numerics.Complex.Subtract#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.subtract/vb/subtract1.vb#1)] + + ]]> + + + @@ -3598,11 +3689,12 @@ This API is not CLS-compliant. - To be added. - To be added. - To be added. - To be added. + The double value to subtract from (the minuend). + The complex value to subtract (the subtrahend). + Subtracts one complex number from a double number and returns the result. + The result of subtracting from , as a complex number. To be added. + @@ -3631,11 +3723,12 @@ This API is not CLS-compliant. - To be added. - To be added. - To be added. - To be added. + The complex value to subtract from (the minuend). + The double value to subtract (the subtrahend). + Subtracts one double number from a complex number and returns the result. + The result of subtracting from , as a complex number. To be added. + @@ -3679,28 +3772,7 @@ This API is not CLS-compliant. The value to subtract (the subtrahend). Subtracts one complex number from another and returns the result. The result of subtracting from . - - or . - - Languages that do not support custom operators can use the method to perform subtraction using complex numbers. - - - -## Examples - The following example subtracts each complex number in an array from a complex number. - - [!code-csharp[System.Numerics.Complex.Subtract#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.subtract/cs/subtract1.cs#1)] - [!code-vb[System.Numerics.Complex.Subtract#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.subtract/vb/subtract1.vb#1)] - - ]]> - + To be added. From ceab30e96ec3c5ebda138040b5dc6302f11d6638 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Lopez <1175054+carlossanlop@users.noreply.github.com> Date: Fri, 2 Aug 2019 10:10:40 -0700 Subject: [PATCH 02/10] suggestions by Jozkee and tannergooding --- xml/System.Numerics/Complex.xml | 52 ++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/xml/System.Numerics/Complex.xml b/xml/System.Numerics/Complex.xml index 90bd6ef99b5..82652d17b80 100644 --- a/xml/System.Numerics/Complex.xml +++ b/xml/System.Numerics/Complex.xml @@ -1838,7 +1838,7 @@ 4.1.1.0 - Adds a specified number to another specified number. + Adds a specified number to another specified number, where at least one of them is a complex number, and the other could be a double-precision real number. - The double value to add. + The double-precision real value to add. The complex value to add. - Adds a double number to a complex number. + Adds a double-precision real number to a complex number. The sum of and as a complex number. To be added. @@ -1932,8 +1932,8 @@ The following example illustrates addition with complex numbers. The complex value to add. - The double value to add. - Adds a complex number to a double number. + The double-precision real value to add. + Adds a complex number to a double-precision real number. The sum of and as a complex number. To be added. @@ -1985,7 +1985,7 @@ The following example illustrates addition with complex numbers. 4.1.1.0 - Divides a specified number by another specified number. + Divides a specified number by another specified number, where at least one of them is a complex number, and the other could be a double-precision real number. - The double value to be divided. + The double-precision real value to be divided. The complex value to divide by. - Divides a specified double number by a specified complex number. + Divides a specified double-precision real number by a specified complex number. The result of dividing by , as a complex number. To be added. @@ -2071,8 +2071,8 @@ The equivalent method for this operator is The complex value to be divided. - The double value to divide by. - Divides a specified complex number by a specified double number. + The double-precision real value to divide by. + Divides a specified complex number by a specified double-precision real number. The result of dividing by , as a complex number. To be added. @@ -2887,7 +2887,7 @@ This API is not CLS-compliant. 4.1.1.0 - Multiplies a specified number by another specified number. + Multiplies a specified number by another specified number, where at least one of them is a complex number, and the other could be a double-precision real number. - The double value to multiply. + The double-precision real value to multiply. The complex value to multiply. - Multiplies a specified double number by a specified complex number. + Multiplies a specified double-precision real number by a specified complex number. The product of and , as a complex number. To be added. @@ -2973,8 +2973,8 @@ The equivalent method for this operator is The complex value to multiply. - The double value to multiply. - Multiplies specified complex number by a specified double number. + The double-precision real value to multiply. + Multiplies the specified complex number by a specified double-precision real number. The product of and , as a complex number. To be added. @@ -3026,7 +3026,7 @@ The equivalent method for this operator is 4.1.1.0 - Substracts a specified number from another specified number. + Subtracts a specified number from another specified number, where at least one of them is a complex number, and the other could be a double-precision real number. - The double value to subtract from (the minuend). + The double-precision real value to subtract from (the minuend). The complex value to subtract (the subtrahend). - Subtracts a complex number from a double number. + Subtracts a complex number from a double-precision real number. The result of subtracting from , as a complex number. To be added. @@ -3112,8 +3112,8 @@ The equivalent method for this operator is The complex value to subtract from (the minuend). - The double value to subtract (the subtrahend). - Subtracts a double number from a complex number. + The double-precision real value to subtract (the subtrahend). + Subtracts a double-precision real number from a complex number. The result of subtracting from , as a complex number. To be added. @@ -3638,7 +3638,7 @@ The equivalent method for this operator is 4.1.1.0 - Substracts a specified number from another specified number and returns the result. + Subtracts a specified number from another specified number, where at least one of them is a complex number, and the other could be a double-precision real number, and returns the result. - The double value to subtract from (the minuend). + The double-precision real value to subtract from (the minuend). The complex value to subtract (the subtrahend). - Subtracts one complex number from a double number and returns the result. + Subtracts one complex number from a double-precision real number and returns the result. The result of subtracting from , as a complex number. To be added. @@ -3724,8 +3724,8 @@ The following example subtracts each complex number in an array from a complex n The complex value to subtract from (the minuend). - The double value to subtract (the subtrahend). - Subtracts one double number from a complex number and returns the result. + The double-precision real value to subtract (the subtrahend). + Subtracts one double-precision real number from a complex number and returns the result. The result of subtracting from , as a complex number. To be added. @@ -4195,4 +4195,4 @@ The following example subtracts each complex number in an array from a complex n - \ No newline at end of file + From a31a4ad4643f80a0eb7074ac18046d8fcb3b7468 Mon Sep 17 00:00:00 2001 From: carlossanlop Date: Fri, 2 Aug 2019 12:36:00 -0700 Subject: [PATCH 03/10] Add individual remarks, apply suggestions by mairaw, Jozkee, tannergooding --- xml/System.Numerics/Complex.xml | 342 ++++++++++++++++++++++++++------ 1 file changed, 283 insertions(+), 59 deletions(-) diff --git a/xml/System.Numerics/Complex.xml b/xml/System.Numerics/Complex.xml index 82652d17b80..fdb5992afea 100644 --- a/xml/System.Numerics/Complex.xml +++ b/xml/System.Numerics/Complex.xml @@ -1833,19 +1833,14 @@ - - System.Runtime.Numerics - 4.1.1.0 - Adds a specified number to another specified number, where at least one of them is a complex number, and the other could be a double-precision real number. - - method defines the addition operation for complex numbers. It enables code such as the following: +The operators allow performing addition operations that involve complex numbers. They enable code such as the following: [!code-csharp[System.Numerics.Complex.Add#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.add/cs/add3.cs#3)] [!code-vb[System.Numerics.Complex.Add#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.add/vb/add3.vb#3)] @@ -1854,15 +1849,21 @@ The addition of a complex number, a + bi, and a second complex number, c + di, t (a + c) + (b + d)i -If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . +The addition of a real number (which can be regarded as the complex number a + 0i) and a complex number (c + di) takes the following form: + +(a + c) + di + +The addition of a complex number (a + bi) and a real number (which can be regarded as the complex number c + 0i) takes the following form: -Languages that do not support custom operators can call the method instead. +(a + c) + bi -The equivalent method for this operator is . +If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . + +Languages that do not support custom operators can call the equivalent group of methods instead. ## Examples -The following example illustrates addition with complex numbers. +The following example illustrates addition with complex numbers: [!code-csharp[System.Numerics.Complex.Add#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.add/cs/add2.cs#2)] [!code-vb[System.Numerics.Complex.Add#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.add/vb/add2.vb#2)] @@ -1899,9 +1900,23 @@ The following example illustrates addition with complex numbers. The double-precision real value to add. The complex value to add. - Adds a double-precision real number to a complex number. + Adds a double-precision real number to a complex number. The sum of and as a complex number. - To be added. + + or . + +Languages that do not support custom operators can call the equivalent method instead. + + ]]> + @@ -1935,7 +1950,21 @@ The following example illustrates addition with complex numbers. The double-precision real value to add. Adds a complex number to a double-precision real number. The sum of and as a complex number. - To be added. + + or . + +Languages that do not support custom operators can call the equivalent method instead. + + ]]> + @@ -1975,15 +2004,25 @@ The following example illustrates addition with complex numbers. The second complex value to add. Adds two complex numbers. The sum of and . - To be added. + + or . + +Languages that do not support custom operators can call the equivalent method instead. + + ]]> + - - System.Runtime.Numerics - 4.1.1.0 - Divides a specified number by another specified number, where at least one of them is a complex number, and the other could be a double-precision real number. @@ -1991,7 +2030,7 @@ The following example illustrates addition with complex numbers. ## Remarks -The method defines the division operation for complex numbers. It enables code such as the following: +The operators allow performing division operation that involve complex numbers. They enable code such as the following: [!code-csharp[System.Numerics.Complex.Divide#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.divide/cs/divide2.cs#2)] [!code-vb[System.Numerics.Complex.Divide#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.divide/vb/divide2.vb#2)] @@ -2000,11 +2039,17 @@ The division of a complex number, a + bi, and a second complex number, c + di, t ((ac + bd) / (c2 + d2)) + ((bc - ad) / (c2 + d2)i -If the division results in an overflow in either the real or imaginary component, the value of that component is either or . +The division of a complex number (a + bi) and a real number (which can be regarded as the complex number c + 0i) takes the following form: -Languages that do not support custom operators and operator overloading can call the method instead. +(ac / c2) + (bc / c2)i -The equivalent method for this operator is . +The division of a real number (which can be regarded as the complex number a + 0i) and a complex number (c + di) takes the following form: + +(ac / (c2 + d2)) + (ad / (c2 + d2)i + +If the division results in an overflow in either the real or imaginary component, the value of that component is either or . + +Languages that do not support custom operators and operator overloading can call the equivalent group of method instead. ]]> @@ -2040,7 +2085,21 @@ The equivalent method for this operator is The complex value to divide by. Divides a specified double-precision real number by a specified complex number. The result of dividing by , as a complex number. - To be added. + + 2 + d2)) + (ad / (c2 + d2)i + +If the division results in an overflow in either the real or imaginary component, the value of that component is either or . + +Languages that do not support custom operators and operator overloading can call the equivalent method instead. + + ]]> + @@ -2074,7 +2133,21 @@ The equivalent method for this operator is The double-precision real value to divide by. Divides a specified complex number by a specified double-precision real number. The result of dividing by , as a complex number. - To be added. + + 2) + (bc / c2)i + +If the division results in an overflow in either the real or imaginary component, the value of that component is either or . + +Languages that do not support custom operators and operator overloading can call the equivalent method instead. + + ]]> + @@ -2114,7 +2187,21 @@ The equivalent method for this operator is The complex value to divide by. Divides a specified complex number by another specified complex number. The result of dividing by . - To be added. + + 2 + d2)) + ((bc - ad) / (c2 + d2)i + +If the division results in an overflow in either the real or imaginary component, the value of that component is either or . + +Languages that do not support custom operators and operator overloading can call the equivalent method instead. + + ]]> + @@ -2882,10 +2969,6 @@ This API is not CLS-compliant. - - System.Runtime.Numerics - 4.1.1.0 - Multiplies a specified number by another specified number, where at least one of them is a complex number, and the other could be a double-precision real number. @@ -2893,7 +2976,7 @@ This API is not CLS-compliant. ## Remarks -The method defines the operation of the multiplication operator for complex numbers. It enables code such as the following: +The operators allow performing multiplication operations that involve complex numbers. They enable code such as the following: [!code-csharp[System.Numerics.Complex.Multiply#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.multiply/cs/multiply2.cs#2)] [!code-vb[System.Numerics.Complex.Multiply#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.multiply/vb/multiply2.vb#2)] @@ -2902,13 +2985,19 @@ The multiplication of a complex number, a + bi, and a second complex number, c + (ac - bd) + (ad + bc)i -If the multiplication results in an overflow in either the real or imaginary component, the value of that component is either or . +The multiplication of a complex number (a + bi) and a real number (which can be regarded as the complex number c + 0i) takes the following form: + +ac + bci + +The multiplication of a real number (which can be regarded as the complex number a + 0i) and a complex number (c + di) takes the following form: -Languages that do not support custom operators can call the method instead. +ac + adi -The equivalent method for this operator is ]]>. +If the multiplication results in an overflow in either the real or imaginary component, the value of that component is either or . + +Languages that do not support custom operators can call the equivalent group of methods instead. - + ]]> @@ -2942,7 +3031,21 @@ The equivalent method for this operator is The complex value to multiply. Multiplies a specified double-precision real number by a specified complex number. The product of and , as a complex number. - To be added. + + or . + +Languages that do not support custom operators can call the equivalent method instead. + + ]]> + @@ -2976,7 +3079,21 @@ The equivalent method for this operator is The double-precision real value to multiply. Multiplies the specified complex number by a specified double-precision real number. The product of and , as a complex number. - To be added. + + or . + +Languages that do not support custom operators can call the equivalent method instead. + + ]]> + @@ -3016,15 +3133,25 @@ The equivalent method for this operator is The second complex value to multiply. Multiplies two specified complex numbers. The product of and . - To be added. + + or . + +Languages that do not support custom operators can call the equivalent method instead. + + ]]> + - - System.Runtime.Numerics - 4.1.1.0 - Subtracts a specified number from another specified number, where at least one of them is a complex number, and the other could be a double-precision real number. @@ -3032,20 +3159,26 @@ The equivalent method for this operator is method defines the operation of the subtraction operator for complex numbers. It enables code such as the following: +The operators allow performing subtraction operations that involve complex numbers. They enable code such as the following: [!code-csharp[System.Numerics.Complex.Subtract#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.subtract/cs/subtract2.cs#2)] [!code-vb[System.Numerics.Complex.Subtract#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.subtract/vb/subtract2.vb#2)] -If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . - The subtraction of a complex number, c + di, from another complex number, a + bi, takes the following form: (a - c) + (b - d)i -Languages that do not support custom operators can call the method instead. +The subtraction of a real number (which can be regarded as the complex number c + 0i) from a complex number (a + bi) takes the following form: + +(a - c) + bi + +The subtraction of a complex number (c + di) from a real number (which can be regarded as the complex number a + 0i) takes the following form: -The equivalent method for this operator is . +(a - c) - di + +If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . + +Languages that do not support custom operators can call the equivalent group of methods instead. ]]> @@ -3081,7 +3214,21 @@ The equivalent method for this operator is The complex value to subtract (the subtrahend). Subtracts a complex number from a double-precision real number. The result of subtracting from , as a complex number. - To be added. + + or . + +Languages that do not support custom operators can call the method instead. + + ]]> + @@ -3115,7 +3262,21 @@ The equivalent method for this operator is The double-precision real value to subtract (the subtrahend). Subtracts a double-precision real number from a complex number. The result of subtracting from , as a complex number. - To be added. + + or . + +Languages that do not support custom operators can call the method instead. + + ]]> + @@ -3155,7 +3316,21 @@ The equivalent method for this operator is The value to subtract (the subtrahend). Subtracts a complex number from another complex number. The result of subtracting from . - To be added. + + or . + +Languages that do not support custom operators can call the method instead. + + ]]> + @@ -3633,10 +3808,6 @@ The equivalent method for this operator is - - System.Runtime.Numerics - 4.1.1.0 - Subtracts a specified number from another specified number, where at least one of them is a complex number, and the other could be a double-precision real number, and returns the result. @@ -3644,17 +3815,28 @@ The equivalent method for this operator is methods allow performing subtraction operations that involve complex numbers. + + The subtraction of a complex number, c + di, from another complex number, a + bi, takes the following form: (a - c) + (b - d)i +The subtraction of a real number (which can be regarded as the complex number c + 0i) from a complex number (a + bi) takes the following form: + +(a - c) + bi + +The subtraction of a complex number (c + di) from a real number (which can be regarded as the complex number a + 0i) takes the following form: + +(a - c) - di + If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . -Languages that do not support custom operators can use the method to perform subtraction using complex numbers. +Languages that support custom operators can use the equivalent group of operators too. ## Examples -The following example subtracts each complex number in an array from a complex number. +The following example subtracts each complex number in an array from a complex number: [!code-csharp[System.Numerics.Complex.Subtract#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.subtract/cs/subtract1.cs#1)] [!code-vb[System.Numerics.Complex.Subtract#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.subtract/vb/subtract1.vb#1)] @@ -3693,7 +3875,21 @@ The following example subtracts each complex number in an array from a complex n The complex value to subtract (the subtrahend). Subtracts one complex number from a double-precision real number and returns the result. The result of subtracting from , as a complex number. - To be added. + + or . + +Languages that support custom operators can use the equivalent operator too. + + ]]> + @@ -3727,7 +3923,21 @@ The following example subtracts each complex number in an array from a complex n The double-precision real value to subtract (the subtrahend). Subtracts one double-precision real number from a complex number and returns the result. The result of subtracting from , as a complex number. - To be added. + + or . + +Languages that support custom operators can use the equivalent operator too. + + ]]> + @@ -3772,7 +3982,21 @@ The following example subtracts each complex number in an array from a complex n The value to subtract (the subtrahend). Subtracts one complex number from another and returns the result. The result of subtracting from . - To be added. + + or . + +Languages that support custom operators can use the equivalent operator too. + + ]]> + From 5355a9826f81ef0f6944ba38b5effee1182061da Mon Sep 17 00:00:00 2001 From: carlossanlop Date: Fri, 2 Aug 2019 12:39:58 -0700 Subject: [PATCH 04/10] Method -> operation name --- xml/System.Numerics/Complex.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/xml/System.Numerics/Complex.xml b/xml/System.Numerics/Complex.xml index fdb5992afea..e7278fc9cd1 100644 --- a/xml/System.Numerics/Complex.xml +++ b/xml/System.Numerics/Complex.xml @@ -1857,7 +1857,7 @@ The addition of a complex number (a + bi) and a real number (which can be regard (a + c) + bi -If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . +If the addition results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the equivalent group of methods instead. @@ -1911,7 +1911,7 @@ The addition of a real number (which can be regarded as the complex number a + 0 (a + c) + di -If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . +If the addition results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the equivalent method instead. @@ -1959,7 +1959,7 @@ The addition of a complex number (a + bi) and a real number (which can be regard (a + c) + bi -If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . +If the addition results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the equivalent method instead. @@ -2013,7 +2013,7 @@ The addition of a complex number, a + bi, and a second complex number, c + di, t (a + c) + (b + d)i -If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . +If the addition results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the equivalent method instead. @@ -3176,7 +3176,7 @@ The subtraction of a complex number (c + di) from a real number (which can be re (a - c) - di -If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . +If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the equivalent group of methods instead. @@ -3223,7 +3223,7 @@ The subtraction of a complex number (c + di) from a real number (which can be re (a - c) - di -If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . +If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the method instead. @@ -3271,7 +3271,7 @@ The subtraction of a real number (which can be regarded as the complex number c (a - c) + bi -If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . +If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the method instead. @@ -3325,7 +3325,7 @@ The subtraction of a complex number, c + di, from another complex number, a + bi (a - c) + (b - d)i -If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . +If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the method instead. @@ -3830,7 +3830,7 @@ The subtraction of a complex number (c + di) from a real number (which can be re (a - c) - di -If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . +If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that support custom operators can use the equivalent group of operators too. @@ -3884,7 +3884,7 @@ The subtraction of a complex number (c + di) from a real number (which can be re (a - c) - di -If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . +If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that support custom operators can use the equivalent operator too. @@ -3932,7 +3932,7 @@ The subtraction of a real number (which can be regarded as the complex number c (a - c) + bi -If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . +If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that support custom operators can use the equivalent operator too. @@ -3991,7 +3991,7 @@ The subtraction of a complex number, c + di, from another complex number, a + bi (a - c) + (b - d)i -If the method call results in an overflow in either the real or imaginary component, the value of that component is either or . +If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that support custom operators can use the equivalent operator too. From eeee6a39cabb2b90b367a31f76af4e745824cc52 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Lopez <1175054+carlossanlop@users.noreply.github.com> Date: Mon, 5 Aug 2019 09:49:52 -0700 Subject: [PATCH 05/10] suggestions by rpetrusha and Jozkee Co-Authored-By: David Cantu Co-Authored-By: Ron Petrusha --- xml/System.Numerics/Complex.xml | 34 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/xml/System.Numerics/Complex.xml b/xml/System.Numerics/Complex.xml index e7278fc9cd1..7015d8b174f 100644 --- a/xml/System.Numerics/Complex.xml +++ b/xml/System.Numerics/Complex.xml @@ -1840,7 +1840,7 @@ ## Remarks -The operators allow performing addition operations that involve complex numbers. They enable code such as the following: +The operator allows performing addition operations that involve complex numbers. It enables code such as the following: [!code-csharp[System.Numerics.Complex.Add#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.add/cs/add3.cs#3)] [!code-vb[System.Numerics.Complex.Add#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.add/vb/add3.vb#3)] @@ -2030,7 +2030,7 @@ Languages that do not support custom operators can call the operators allow performing division operation that involve complex numbers. They enable code such as the following: +The operator allows performing division operations that involve complex numbers. It enables code such as the following: [!code-csharp[System.Numerics.Complex.Divide#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.divide/cs/divide2.cs#2)] [!code-vb[System.Numerics.Complex.Divide#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.divide/vb/divide2.vb#2)] @@ -2976,7 +2976,7 @@ This API is not CLS-compliant. ## Remarks -The operators allow performing multiplication operations that involve complex numbers. They enable code such as the following: +The operator allows performing multiplication operations that involve complex numbers. It enables code such as the following: [!code-csharp[System.Numerics.Complex.Multiply#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.multiply/cs/multiply2.cs#2)] [!code-vb[System.Numerics.Complex.Multiply#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.multiply/vb/multiply2.vb#2)] @@ -3159,7 +3159,7 @@ Languages that do not support custom operators can call the operators allow performing subtraction operations that involve complex numbers. They enable code such as the following: +The operator allows performing subtraction operations that involve complex numbers. It enables code such as the following: [!code-csharp[System.Numerics.Complex.Subtract#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.subtract/cs/subtract2.cs#2)] [!code-vb[System.Numerics.Complex.Subtract#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.subtract/vb/subtract2.vb#2)] @@ -3176,7 +3176,7 @@ The subtraction of a complex number (c + di) from a real number (which can be re (a - c) - di -If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . +If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the equivalent group of methods instead. @@ -3223,7 +3223,7 @@ The subtraction of a complex number (c + di) from a real number (which can be re (a - c) - di -If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . +If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the method instead. @@ -3271,7 +3271,7 @@ The subtraction of a real number (which can be regarded as the complex number c (a - c) + bi -If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . +If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the method instead. @@ -3325,7 +3325,7 @@ The subtraction of a complex number, c + di, from another complex number, a + bi (a - c) + (b - d)i -If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . +If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the method instead. @@ -3815,7 +3815,7 @@ Languages that do not support custom operators can call the methods allow performing subtraction operations that involve complex numbers. +The method allows subtraction operations that involve complex numbers. The subtraction of a complex number, c + di, from another complex number, a + bi, takes the following form: @@ -3830,9 +3830,9 @@ The subtraction of a complex number (c + di) from a real number (which can be re (a - c) - di -If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . +If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . -Languages that support custom operators can use the equivalent group of operators too. +Languages that support custom operators can use the equivalent group of operators too. ## Examples @@ -3884,9 +3884,9 @@ The subtraction of a complex number (c + di) from a real number (which can be re (a - c) - di -If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . +If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . -Languages that support custom operators can use the equivalent operator too. +Languages that support custom operators can use the equivalent operator too. ]]> @@ -3932,9 +3932,9 @@ The subtraction of a real number (which can be regarded as the complex number c (a - c) + bi -If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . +If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . -Languages that support custom operators can use the equivalent operator too. +Languages that support custom operators can use the equivalent operator too. ]]> @@ -3991,9 +3991,9 @@ The subtraction of a complex number, c + di, from another complex number, a + bi (a - c) + (b - d)i -If the substraction results in an overflow in either the real or imaginary component, the value of that component is either or . +If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . -Languages that support custom operators can use the equivalent operator too. +Languages that support custom operators can use the equivalent operator too. ]]> From d9a4e2be43d7f8870f09587b56695abed2120606 Mon Sep 17 00:00:00 2001 From: carlossanlop Date: Mon, 5 Aug 2019 09:56:24 -0700 Subject: [PATCH 06/10] suggestions by rpetrusha and Jozkee --- xml/System.Numerics/Complex.xml | 91 --------------------------------- 1 file changed, 91 deletions(-) diff --git a/xml/System.Numerics/Complex.xml b/xml/System.Numerics/Complex.xml index 7015d8b174f..89e8fb979ca 100644 --- a/xml/System.Numerics/Complex.xml +++ b/xml/System.Numerics/Complex.xml @@ -1845,18 +1845,6 @@ The operator allows performing add [!code-csharp[System.Numerics.Complex.Add#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.add/cs/add3.cs#3)] [!code-vb[System.Numerics.Complex.Add#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.add/vb/add3.vb#3)] -The addition of a complex number, a + bi, and a second complex number, c + di, takes the following form: - -(a + c) + (b + d)i - -The addition of a real number (which can be regarded as the complex number a + 0i) and a complex number (c + di) takes the following form: - -(a + c) + di - -The addition of a complex number (a + bi) and a real number (which can be regarded as the complex number c + 0i) takes the following form: - -(a + c) + bi - If the addition results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the equivalent group of methods instead. @@ -1911,8 +1899,6 @@ The addition of a real number (which can be regarded as the complex number a + 0 (a + c) + di -If the addition results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that do not support custom operators can call the equivalent method instead. ]]> @@ -1959,8 +1945,6 @@ The addition of a complex number (a + bi) and a real number (which can be regard (a + c) + bi -If the addition results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that do not support custom operators can call the equivalent method instead. ]]> @@ -2013,8 +1997,6 @@ The addition of a complex number, a + bi, and a second complex number, c + di, t (a + c) + (b + d)i -If the addition results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that do not support custom operators can call the equivalent method instead. ]]> @@ -2035,18 +2017,6 @@ The operator allows performing div [!code-csharp[System.Numerics.Complex.Divide#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.divide/cs/divide2.cs#2)] [!code-vb[System.Numerics.Complex.Divide#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.divide/vb/divide2.vb#2)] -The division of a complex number, a + bi, and a second complex number, c + di, takes the following form: - -((ac + bd) / (c2 + d2)) + ((bc - ad) / (c2 + d2)i - -The division of a complex number (a + bi) and a real number (which can be regarded as the complex number c + 0i) takes the following form: - -(ac / c2) + (bc / c2)i - -The division of a real number (which can be regarded as the complex number a + 0i) and a complex number (c + di) takes the following form: - -(ac / (c2 + d2)) + (ad / (c2 + d2)i - If the division results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators and operator overloading can call the equivalent group of method instead. @@ -2094,8 +2064,6 @@ The division of a real number (which can be regarded as the complex number a + 0 (ac / (c2 + d2)) + (ad / (c2 + d2)i -If the division results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that do not support custom operators and operator overloading can call the equivalent method instead. ]]> @@ -2142,8 +2110,6 @@ The division of a complex number (a + bi) and a real number (which can be regard (ac / c2) + (bc / c2)i -If the division results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that do not support custom operators and operator overloading can call the equivalent method instead. ]]> @@ -2196,8 +2162,6 @@ The division of a complex number, a + bi, and a second complex number, c + di, t ((ac + bd) / (c2 + d2)) + ((bc - ad) / (c2 + d2)i -If the division results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that do not support custom operators and operator overloading can call the equivalent method instead. ]]> @@ -2981,18 +2945,6 @@ The operator allows performing mul [!code-csharp[System.Numerics.Complex.Multiply#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.multiply/cs/multiply2.cs#2)] [!code-vb[System.Numerics.Complex.Multiply#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.multiply/vb/multiply2.vb#2)] -The multiplication of a complex number, a + bi, and a second complex number, c + di, takes the following form: - -(ac - bd) + (ad + bc)i - -The multiplication of a complex number (a + bi) and a real number (which can be regarded as the complex number c + 0i) takes the following form: - -ac + bci - -The multiplication of a real number (which can be regarded as the complex number a + 0i) and a complex number (c + di) takes the following form: - -ac + adi - If the multiplication results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the equivalent group of methods instead. @@ -3040,8 +2992,6 @@ The multiplication of a real number (which can be regarded as the complex number ac + adi -If the multiplication results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that do not support custom operators can call the equivalent method instead. ]]> @@ -3088,8 +3038,6 @@ The multiplication of a complex number (a + bi) and a real number (which can be ac + bci -If the multiplication results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that do not support custom operators can call the equivalent method instead. ]]> @@ -3142,8 +3090,6 @@ The multiplication of a complex number, a + bi, and a second complex number, c + (ac - bd) + (ad + bc)i -If the multiplication results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that do not support custom operators can call the equivalent method instead. ]]> @@ -3164,18 +3110,6 @@ The operator allows performing [!code-csharp[System.Numerics.Complex.Subtract#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.subtract/cs/subtract2.cs#2)] [!code-vb[System.Numerics.Complex.Subtract#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.subtract/vb/subtract2.vb#2)] -The subtraction of a complex number, c + di, from another complex number, a + bi, takes the following form: - -(a - c) + (b - d)i - -The subtraction of a real number (which can be regarded as the complex number c + 0i) from a complex number (a + bi) takes the following form: - -(a - c) + bi - -The subtraction of a complex number (c + di) from a real number (which can be regarded as the complex number a + 0i) takes the following form: - -(a - c) - di - If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the equivalent group of methods instead. @@ -3223,8 +3157,6 @@ The subtraction of a complex number (c + di) from a real number (which can be re (a - c) - di -If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that do not support custom operators can call the method instead. ]]> @@ -3271,8 +3203,6 @@ The subtraction of a real number (which can be regarded as the complex number c (a - c) + bi -If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that do not support custom operators can call the method instead. ]]> @@ -3325,8 +3255,6 @@ The subtraction of a complex number, c + di, from another complex number, a + bi (a - c) + (b - d)i -If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that do not support custom operators can call the method instead. ]]> @@ -3817,19 +3745,6 @@ Languages that do not support custom operators can call the method allows subtraction operations that involve complex numbers. - -The subtraction of a complex number, c + di, from another complex number, a + bi, takes the following form: - -(a - c) + (b - d)i - -The subtraction of a real number (which can be regarded as the complex number c + 0i) from a complex number (a + bi) takes the following form: - -(a - c) + bi - -The subtraction of a complex number (c + di) from a real number (which can be regarded as the complex number a + 0i) takes the following form: - -(a - c) - di - If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that support custom operators can use the equivalent group of operators too. @@ -3884,8 +3799,6 @@ The subtraction of a complex number (c + di) from a real number (which can be re (a - c) - di -If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that support custom operators can use the equivalent operator too. ]]> @@ -3932,8 +3845,6 @@ The subtraction of a real number (which can be regarded as the complex number c (a - c) + bi -If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that support custom operators can use the equivalent operator too. ]]> @@ -3991,8 +3902,6 @@ The subtraction of a complex number, c + di, from another complex number, a + bi (a - c) + (b - d)i -If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . - Languages that support custom operators can use the equivalent operator too. ]]> From d192f32d4fe05ac11308e0a42b2ebcde61d34ec9 Mon Sep 17 00:00:00 2001 From: carlossanlop Date: Mon, 5 Aug 2019 11:22:55 -0700 Subject: [PATCH 07/10] Tables with efficiency gain --- xml/System.Numerics/Complex.xml | 55 +++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/xml/System.Numerics/Complex.xml b/xml/System.Numerics/Complex.xml index 89e8fb979ca..d476983d535 100644 --- a/xml/System.Numerics/Complex.xml +++ b/xml/System.Numerics/Complex.xml @@ -1836,7 +1836,8 @@ Adds a specified number to another specified number, where at least one of them is a complex number, and the other could be a double-precision real number. - + equivalent group of methods instead. +The operators that receive one double are more efficient than the operators that receive two Complex numbers: + +| Operator | Cost | +|--------------------|---------| +| Complex + Complex | 2 flops | +| Complex + double
-or-
double + Complex | 1 flop | + ## Examples The following example illustrates addition with complex numbers: @@ -2008,7 +2016,8 @@ Languages that do not support custom operators can call the Divides a specified number by another specified number, where at least one of them is a complex number, and the other could be a double-precision real number. - + equivalent group of method instead. +The operators that receive one double are more efficient than the operators that receive two Complex numbers: + +| Operator | Cost | +|-------------------|-----------------------------------| +| Complex / Complex | 9 flops | +| Complex / double | 2 flops (largest efficiency gain) | +| double / Complex | 6 flops | + ]]>
@@ -2936,7 +2953,8 @@ This API is not CLS-compliant. Multiplies a specified number by another specified number, where at least one of them is a complex number, and the other could be a double-precision real number. - + equivalent group of methods instead. +The operators that receive one double are more efficient than the operators that receive two Complex numbers: + +| Operator | Cost | +|-------------------|---------| +| Complex * Complex | 6 flops | +| Complex * double
-or-
double * Complex | 2 flops | + ]]>
@@ -2994,6 +3019,8 @@ ac + adi Languages that do not support custom operators can call the equivalent method instead. +There are implicit casts from double -> Complex, so it's currently possible to write e.g. 2.5 * z for Complex z, but in addition to the cast, this costs 6 flops for a Complex * Complex multiply, while it's possible to implement a double * Complex multiply directly in 2 flops. + ]]> @@ -3101,7 +3128,8 @@ Languages that do not support custom operators can call the Subtracts a specified number from another specified number, where at least one of them is a complex number, and the other could be a double-precision real number. - + operator allows performing If the subtraction results in an overflow in either the real or imaginary component, the value of that component is either or . Languages that do not support custom operators can call the equivalent group of methods instead. - + +The operators that receive one double are more efficient than the operators that receive two Complex numbers: + +| Operator | Cost | +|-------------------|---------| +| Complex + Complex | 2 flops | +| Complex + double
-or-
double + Complex | 1 flop | + ]]>
@@ -3739,7 +3774,8 @@ Languages that do not support custom operators can call the Subtracts a specified number from another specified number, where at least one of them is a complex number, and the other could be a double-precision real number, and returns the result. - + equivalent group of operators too. +The methods that receive one double are more efficient than the method that receive two Complex numbers: + +| Operator | Cost | +|-------------------|---------| +| Complex - Complex | 2 flops | +| Complex - double
-or-
double - Complex | 1 flop | + ## Examples The following example subtracts each complex number in an array from a complex number: From dc43aa42175f1c9fc90d29bb62b5e26d3d74969d Mon Sep 17 00:00:00 2001 From: carlossanlop Date: Mon, 5 Aug 2019 11:27:23 -0700 Subject: [PATCH 08/10] operator -> operation --- xml/System.Numerics/Complex.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xml/System.Numerics/Complex.xml b/xml/System.Numerics/Complex.xml index d476983d535..f8d6416c049 100644 --- a/xml/System.Numerics/Complex.xml +++ b/xml/System.Numerics/Complex.xml @@ -1852,7 +1852,7 @@ Languages that do not support custom operators can call the operators that receive one double are more efficient than the operators that receive two Complex numbers: -| Operator | Cost | +| Operation | Cost | |--------------------|---------| | Complex + Complex | 2 flops | | Complex + double
-or-
double + Complex | 1 flop | @@ -2032,7 +2032,7 @@ Languages that do not support custom operators and operator overloading can call The operators that receive one double are more efficient than the operators that receive two Complex numbers: -| Operator | Cost | +| Operation | Cost | |-------------------|-----------------------------------| | Complex / Complex | 9 flops | | Complex / double | 2 flops (largest efficiency gain) | @@ -2969,7 +2969,7 @@ Languages that do not support custom operators can call the operators that receive one double are more efficient than the operators that receive two Complex numbers: -| Operator | Cost | +| Operation | Cost | |-------------------|---------| | Complex * Complex | 6 flops | | Complex * double
-or-
double * Complex | 2 flops | @@ -3144,7 +3144,7 @@ Languages that do not support custom operators can call the operators that receive one double are more efficient than the operators that receive two Complex numbers: -| Operator | Cost | +| Operation | Cost | |-------------------|---------| | Complex + Complex | 2 flops | | Complex + double
-or-
double + Complex | 1 flop | @@ -3787,7 +3787,7 @@ Languages that support custom operators can use the methods that receive one double are more efficient than the method that receive two Complex numbers: -| Operator | Cost | +| Operation | Cost | |-------------------|---------| | Complex - Complex | 2 flops | | Complex - double
-or-
double - Complex | 1 flop | From 3912a42bf805b05a003eef2420aced10ce7db285 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Lopez <1175054+carlossanlop@users.noreply.github.com> Date: Mon, 5 Aug 2019 18:32:01 -0700 Subject: [PATCH 09/10] Remove cost tables --- xml/System.Numerics/Complex.xml | 36 +++++---------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/xml/System.Numerics/Complex.xml b/xml/System.Numerics/Complex.xml index f8d6416c049..1d3f92fd326 100644 --- a/xml/System.Numerics/Complex.xml +++ b/xml/System.Numerics/Complex.xml @@ -1850,12 +1850,7 @@ If the addition results in an overflow in either the real or imaginary component Languages that do not support custom operators can call the equivalent group of methods instead. -The operators that receive one double are more efficient than the operators that receive two Complex numbers: - -| Operation | Cost | -|--------------------|---------| -| Complex + Complex | 2 flops | -| Complex + double
-or-
double + Complex | 1 flop | +The operators that receive one double are more efficient than the operators that receive two Complex numbers. ## Examples @@ -2030,13 +2025,7 @@ If the division results in an overflow in either the real or imaginary component Languages that do not support custom operators and operator overloading can call the equivalent group of method instead. -The operators that receive one double are more efficient than the operators that receive two Complex numbers: - -| Operation | Cost | -|-------------------|-----------------------------------| -| Complex / Complex | 9 flops | -| Complex / double | 2 flops (largest efficiency gain) | -| double / Complex | 6 flops | +The operators that receive one double are more efficient than the operators that receive two Complex numbers. ]]>
@@ -2967,12 +2956,7 @@ If the multiplication results in an overflow in either the real or imaginary com Languages that do not support custom operators can call the equivalent group of methods instead. -The operators that receive one double are more efficient than the operators that receive two Complex numbers: - -| Operation | Cost | -|-------------------|---------| -| Complex * Complex | 6 flops | -| Complex * double
-or-
double * Complex | 2 flops | +The operators that receive one double are more efficient than the operators that receive two Complex numbers. ]]> @@ -3142,12 +3126,7 @@ If the subtraction results in an overflow in either the real or imaginary compon Languages that do not support custom operators can call the equivalent group of methods instead. -The operators that receive one double are more efficient than the operators that receive two Complex numbers: - -| Operation | Cost | -|-------------------|---------| -| Complex + Complex | 2 flops | -| Complex + double
-or-
double + Complex | 1 flop | +The operators that receive one double are more efficient than the operators that receive two Complex numbers. ]]> @@ -3785,12 +3764,7 @@ If the subtraction results in an overflow in either the real or imaginary compon Languages that support custom operators can use the equivalent group of operators too. -The methods that receive one double are more efficient than the method that receive two Complex numbers: - -| Operation | Cost | -|-------------------|---------| -| Complex - Complex | 2 flops | -| Complex - double
-or-
double - Complex | 1 flop | +The methods that receive one double are more efficient than the method that receive two Complex numbers. ## Examples From f2317a65ac8239806ac1b1caec4072a5afc8a349 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Lopez <1175054+carlossanlop@users.noreply.github.com> Date: Tue, 6 Aug 2019 09:29:47 -0700 Subject: [PATCH 10/10] remove unnecessary comment --- xml/System.Numerics/Complex.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/xml/System.Numerics/Complex.xml b/xml/System.Numerics/Complex.xml index 1d3f92fd326..1764baa24bb 100644 --- a/xml/System.Numerics/Complex.xml +++ b/xml/System.Numerics/Complex.xml @@ -3003,7 +3003,6 @@ ac + adi Languages that do not support custom operators can call the equivalent method instead. -There are implicit casts from double -> Complex, so it's currently possible to write e.g. 2.5 * z for Complex z, but in addition to the cast, this costs 6 flops for a Complex * Complex multiply, while it's possible to implement a double * Complex multiply directly in 2 flops. ]]>