Skip to content

Fix incorrect comment in Complex.Zero C# example#12729

Open
biboete wants to merge 3 commits into
dotnet:mainfrom
biboete:fix/complex-zero-comment
Open

Fix incorrect comment in Complex.Zero C# example#12729
biboete wants to merge 3 commits into
dotnet:mainfrom
biboete:fix/complex-zero-comment

Conversation

@biboete

@biboete biboete commented Jun 9, 2026

Copy link
Copy Markdown

Fixes #11229.

In the Complex.Zero example snippet, the comment read:

// Instantiate a complex number with real part 0 and imaginary part 1.

but the code is new Complex(0, 0) (imaginary part 0), and the documented output is (0, 0) / True. Corrected the comment to "imaginary part 0" so it matches the code and output.

Note: the analogous VB snippet (snippets/visualbasic/System.Numerics/Complex/Zero/zero1.vb) has a mirror-image version of this typo ("real part 1" while the code is New Complex(0, 0)) — happy to fix that in this PR too if you'd prefer a single change covering both.

The comment said "imaginary part 1" but the code is `new Complex(0, 0)`
(imaginary part 0) and the documented output is `(0, 0)` / `True`.
Corrected the comment to "imaginary part 0".
@biboete biboete requested a review from a team as a code owner June 9, 2026 17:38
@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 9, 2026
The comment said "imaginary part 1" but the code is `new Complex(0, 0)`
(imaginary part 0) and the documented output is `(0, 0)` / `True`.
Corrected the comment to "imaginary part 0".
@gewarren

gewarren commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@biboete Yes, can you please fix them both in this PR?

Per review feedback, also corrects the mirror-image typo in the VB snippet:
the comment said "real part 1" but the code is New Complex(0, 0).
@biboete

biboete commented Jun 9, 2026

Copy link
Copy Markdown
Author

@gewarren Done — pushed a commit fixing the VB snippet as well (' real part 1' real part 0, matching its New Complex(0, 0)). Both snippets are covered in this PR now.

@gewarren gewarren left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @biboete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error in the comment in the example code of System.Numerics.Complex.Zero

2 participants