Skip to content

Added documentation for System.Numerics.Complex APIs targeted for 3.0 #2946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
257 changes: 178 additions & 79 deletions xml/System.Numerics/Complex.xml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,31 @@
<altmember cref="M:System.Math.Acos(System.Double)" />
</Docs>
</Member>
<MemberGroup MemberName="Add">
<Docs>
<summary>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.</summary>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
The <xref:System.Numerics.Complex.Add%2A> methods allow performing addition operations that involve complex numbers.

If the method call results in an overflow in either the real or imaginary component, the value of the component is either <xref:System.Double.PositiveInfinity?displayProperty=nameWithType> or <xref:System.Double.NegativeInfinity?displayProperty=nameWithType>.

Languages that do not support custom operators can use the <xref:System.Numerics.Complex.Add%2A> method to perform addition with complex numbers.

The <xref:System.Numerics.Complex.Add%2A> methods that receive one double are more efficient than the methods that receive two complex numbers.

## Examples

The following example illustrates addition with complex numbers.

[!code-csharp[System.Numerics.Complex.Add#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.add/cs/add1.cs#1)]
[!code-vb[System.Numerics.Complex.Add#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.add/vb/add1.vb#1)]
]]></format>
</remarks>
</Docs>
</MemberGroup>
<Member MemberName="Add">
<MemberSignature Language="C#" Value="public static System.Numerics.Complex Add (double left, System.Numerics.Complex right);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Numerics.Complex Add(float64 left, valuetype System.Numerics.Complex right) cil managed" />
Expand All @@ -340,11 +365,19 @@
<Parameter Name="right" Type="System.Numerics.Complex" Index="1" FrameworkAlternate="netcore-3.0" />
</Parameters>
<Docs>
<param name="left">To be added.</param>
<param name="right">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<param name="left">The double-precision real value to add.</param>
<param name="right">The complex value to add.</param>
<summary>Adds a double-precision real number to a complex number and returns the result.</summary>
<returns>The sum of <paramref name="left" /> and <paramref name="right" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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
]]></format>
</remarks>
<altmember cref="M:System.Numerics.Complex.op_Addition(System.Double,System.Numerics.Complex)" />
</Docs>
</Member>
<Member MemberName="Add">
Expand Down Expand Up @@ -373,11 +406,19 @@
<Parameter Name="right" Type="System.Double" Index="1" FrameworkAlternate="netcore-3.0" />
</Parameters>
<Docs>
<param name="left">To be added.</param>
<param name="right">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<param name="left">The complex value to add.</param>
<param name="right">The double-precision real value to add.</param>
<summary>Adds a complex number to a double-precision real number and returns the result.</summary>
<returns>The sum of <paramref name="left" /> and <paramref name="right" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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
]]></format>
</remarks>
<altmember cref="M:System.Numerics.Complex.op_Addition(System.Numerics.Complex,System.Double)" />
</Docs>
</Member>
<Member MemberName="Add">
Expand Down Expand Up @@ -428,18 +469,7 @@
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 the component is either <xref:System.Double.PositiveInfinity?displayProperty=nameWithType> or <xref:System.Double.NegativeInfinity?displayProperty=nameWithType>.

Languages that do not support custom operators can use the <xref:System.Numerics.Complex.Add%2A> method to perform addition with complex numbers.



## Examples
The following example illustrates addition with complex numbers.

[!code-csharp[System.Numerics.Complex.Add#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.add/cs/add1.cs#1)]
[!code-vb[System.Numerics.Complex.Add#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.add/vb/add1.vb#1)]


]]></format>
</remarks>
Expand Down Expand Up @@ -721,6 +751,31 @@
<altmember cref="M:System.Math.Cosh(System.Double)" />
</Docs>
</Member>
<MemberGroup MemberName="Divide">
<Docs>
<summary>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.</summary>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
The <xref:System.Numerics.Complex.Divide%2A> methods allow performing division operations that involve complex numbers.

If the calculation of the quotient results in an overflow in either the real or imaginary component, the value of that component is either <xref:System.Double.PositiveInfinity?displayProperty=nameWithType> or <xref:System.Double.NegativeInfinity?displayProperty=nameWithType>.

The <xref:System.Numerics.Complex.Divide%2A> method can be used by languages that do not support custom operators. Its behavior is identical to division using the division operator.

The <xref:System.Numerics.Complex.Divide%2A> methods that receive one double are more efficient than the methods that receive two complex numbers.

## Examples
The following example divides a complex number by each element in an array of complex numbers.

[!code-csharp[System.Numerics.Complex.Divide#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.divide/cs/divide1.cs#1)]
[!code-vb[System.Numerics.Complex.Divide#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.divide/vb/divide1.vb#1)]

]]></format>
</remarks>
</Docs>
</MemberGroup>
<Member MemberName="Divide">
<MemberSignature Language="C#" Value="public static System.Numerics.Complex Divide (double dividend, System.Numerics.Complex divisor);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Numerics.Complex Divide(float64 dividend, valuetype System.Numerics.Complex divisor) cil managed" />
Expand All @@ -747,11 +802,22 @@
<Parameter Name="divisor" Type="System.Numerics.Complex" Index="1" FrameworkAlternate="netcore-3.0" />
</Parameters>
<Docs>
<param name="dividend">To be added.</param>
<param name="divisor">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<param name="dividend">The double-precision real number to be divided.</param>
<param name="divisor">The complex number to divide by.</param>
<summary>Divides one double-precision real number by a complex number and returns the result.</summary>
<returns>The quotient of the division.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks

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 / (c<sup>2</sup> + d<sup>2</sup>)) + (ad / (c<sup>2</sup> + d<sup>2</sup>)i

]]></format>
</remarks>
<altmember cref="M:System.Numerics.Complex.op_Division(System.Double,System.Numerics.Complex)" />
</Docs>
</Member>
<Member MemberName="Divide">
Expand Down Expand Up @@ -780,11 +846,22 @@
<Parameter Name="divisor" Type="System.Double" Index="1" FrameworkAlternate="netcore-3.0" />
</Parameters>
<Docs>
<param name="dividend">To be added.</param>
<param name="divisor">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<param name="dividend">The complex number to be divided.</param>
<param name="divisor">The double-precision real number to divide by.</param>
<summary>Divides one complex number by a double-precision real number and returns the result.</summary>
<returns>The quotient of the division.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks

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 / c<sup>2</sup>) + (bc / c<sup>2</sup>)i

]]></format>
</remarks>
<altmember cref="M:System.Numerics.Complex.op_Division(System.Numerics.Complex,System.Double)" />
</Docs>
</Member>
<Member MemberName="Divide">
Expand Down Expand Up @@ -835,19 +912,7 @@
The division of a complex number, a + bi, by a second complex number, number, c + di, takes the following form:

((ac + bd) / (c<sup>2</sup> + d<sup>2</sup>)) + ((bc - ad) / (c<sup>2</sup> + d<sup>2</sup>)i

If the calculation of the quotient results in an overflow in either the real or imaginary component, the value of that component is either <xref:System.Double.PositiveInfinity?displayProperty=nameWithType> or <xref:System.Double.NegativeInfinity?displayProperty=nameWithType>.

The <xref:System.Numerics.Complex.Divide%2A> method can be used by languages that do not support custom operators. Its behavior is identical to division using the division operator.



## Examples
The following example divides a complex number by each element in an array of complex numbers.

[!code-csharp[System.Numerics.Complex.Divide#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.divide/cs/divide1.cs#1)]
[!code-vb[System.Numerics.Complex.Divide#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.divide/vb/divide1.vb#1)]


]]></format>
</remarks>
<altmember cref="M:System.Numerics.Complex.op_Division(System.Numerics.Complex,System.Numerics.Complex)" />
Expand Down Expand Up @@ -1261,7 +1326,7 @@
<ReturnType>System.Numerics.Complex</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<summary>Represents infinity as a complex number.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
Expand Down Expand Up @@ -1290,9 +1355,9 @@
<Parameter Name="value" Type="System.Numerics.Complex" Index="0" FrameworkAlternate="netcore-3.0" />
</Parameters>
<Docs>
<param name="value">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<param name="value">A complex number.</param>
<summary>Determines whether the specified complex number is finite.</summary>
<returns><see langword="true" /> if both, the real and imaginary parts are finite (zero, subnormal or normal); otherwise, <see langword="false" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
Expand Down Expand Up @@ -1321,9 +1386,9 @@
<Parameter Name="value" Type="System.Numerics.Complex" Index="0" FrameworkAlternate="netcore-3.0" />
</Parameters>
<Docs>
<param name="value">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<param name="value">A complex number.</param>
<summary>Returns a value indicating whether the specified complex number evaluates to infinity.</summary>
<returns><see langword="true"/> if either, the real or imaginary part are <see cref="F:System.Double.PositiveInfinity" /> or <see cref="F:System.Double.NegativeInfinity" />; otherwise, <see langword="false"/>.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
Expand Down Expand Up @@ -1352,9 +1417,9 @@
<Parameter Name="value" Type="System.Numerics.Complex" Index="0" FrameworkAlternate="netcore-3.0" />
</Parameters>
<Docs>
<param name="value">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<param name="value">A complex number.</param>
<summary>Returns a value that indicates whether the specified complex instance is not a number (NaN).</summary>
<returns><see langword="true"/> if the specified value is not finite nor infinite; otherwise, <see langword="false"/>.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
Expand Down Expand Up @@ -1570,6 +1635,32 @@
<altmember cref="P:System.Numerics.Complex.Phase" />
</Docs>
</Member>
<MemberGroup MemberName="op_Multiply">
<Docs>
<summary>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.</summary>
<remarks>
<format type="text/markdown">
<![CDATA[

## Remarks

The <xref:System.Numerics.Complex.Multiply%2A> methods allow performing multiplication operations that involve complex numbers.

If the multiplication results in an overflow in either the real or imaginary component, the value of that component is either <xref:System.Double.PositiveInfinity?displayProperty=nameWithType> or <xref:System.Double.NegativeInfinity?displayProperty=nameWithType>.

The <xref:System.Numerics.Complex.Multiply%2A> method is implemented for languages that do not support custom operators. Its behavior is identical to multiplication using the multiplication operator.


## Examples
The following example multiples a complex number by each element in an array of complex numbers.

[!code-csharp[System.Numerics.Complex.Multiply#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.multiply/cs/multiply1.cs#1)]
[!code-vb[System.Numerics.Complex.Multiply#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.multiply/vb/multiply1.vb#1)]

]]></format>
</remarks>
</Docs>
</MemberGroup>
<Member MemberName="Multiply">
<MemberSignature Language="C#" Value="public static System.Numerics.Complex Multiply (double left, System.Numerics.Complex right);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Numerics.Complex Multiply(float64 left, valuetype System.Numerics.Complex right) cil managed" />
Expand All @@ -1596,11 +1687,21 @@
<Parameter Name="right" Type="System.Numerics.Complex" Index="1" FrameworkAlternate="netcore-3.0" />
</Parameters>
<Docs>
<param name="left">To be added.</param>
<param name="right">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<param name="left">The double-precision real number to multiply.</param>
<param name="right">The complex number to multiply.</param>
<summary>Returns the product of a double-precision real number and a complex number.</summary>
<returns>The product of the <paramref name="left" /> and <paramref name="right" /> parameters.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks

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
]]></format>
</remarks>
<altmember cref="M:System.Numerics.Complex.op_Multiply(System.Double,System.Numerics.Complex)" />
</Docs>
</Member>
<Member MemberName="Multiply">
Expand Down Expand Up @@ -1629,11 +1730,21 @@
<Parameter Name="right" Type="System.Double" Index="1" FrameworkAlternate="netcore-3.0" />
</Parameters>
<Docs>
<param name="left">To be added.</param>
<param name="right">To be added.</param>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
<param name="left">The complex number to multiply.</param>
<param name="right">The double-precision real number to multiply.</param>
<summary>Returns the product of a complex number and a double-precision real number.</summary>
<returns>The product of the <paramref name="left" /> and <paramref name="right" /> parameters.</returns>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks

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
]]></format>
</remarks>
<altmember cref="M:System.Numerics.Complex.op_Multiply(System.Numerics.Complex,System.Double)" />
</Docs>
</Member>
<Member MemberName="Multiply">
Expand Down Expand Up @@ -1685,18 +1796,6 @@

(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 <xref:System.Double.PositiveInfinity?displayProperty=nameWithType> or <xref:System.Double.NegativeInfinity?displayProperty=nameWithType>.

The <xref:System.Numerics.Complex.Multiply%2A> method is implemented for languages that do not support custom operators. Its behavior is identical to multiplication using the multiplication operator.



## Examples
The following example multiples a complex number by each element in an array of complex numbers.

[!code-csharp[System.Numerics.Complex.Multiply#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.numerics.complex.multiply/cs/multiply1.cs#1)]
[!code-vb[System.Numerics.Complex.Multiply#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.numerics.complex.multiply/vb/multiply1.vb#1)]

]]></format>
</remarks>
<altmember cref="M:System.Numerics.Complex.op_Multiply(System.Numerics.Complex,System.Numerics.Complex)" />
Expand Down Expand Up @@ -1724,7 +1823,7 @@
<ReturnType>System.Numerics.Complex</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<summary>Represents a complex instance that is not a number (NaN).</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
Expand Down Expand Up @@ -1906,7 +2005,7 @@ Languages that do not support custom operators can call the <xref:System.Numeric

]]></format>
</remarks>
<altmember cref="M:System.Numerics.Complex.Add(System.NDouble,System.Numerics.Complex)" />
<altmember cref="M:System.Numerics.Complex.Add(System.Double,System.Numerics.Complex)" />
</Docs>
</Member>
<Member MemberName="op_Addition">
Expand Down