Skip to content

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

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions