Skip to content

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

Open
@M-Badger

Description

@M-Badger

Type of issue

Typo

Description

The example code contains a comment that does not match the code example, it states, // Instantiate a complex number with real part 0 and imaginary part 1. (it is the imaginary part being 1 that is erroneous) and then code is as follows, Complex value1 = new Complex(0, 0);

The example code should be modified to :

using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
      Complex value = Complex.Zero;
      Console.WriteLine(value.ToString());

      // Instantiate a complex number with real part 0 and imaginary part 0.
      Complex value1 = new Complex(0, 0);
      Console.WriteLine(value.Equals(value1));
   }
}
// The example displays the following output:
//       (0, 0)
//       True

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.numerics.complex.zero?view=net-9.0

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Numerics/Complex.xml

Document Version Independent Id

eeb72f25-c237-e76b-a13e-e9789868de91

Platform Id

3c62b93e-ec1a-2efb-1fcd-7fcf3b7ac6d5

Article author

@dotnet-bot

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions