Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Complex.Real Property

Gets the real component of the current Complex object.

Namespace:  System.Numerics
Assembly:  System.Numerics (in System.Numerics.dll)
public double Real { get; }

Property Value

Type: System.Double
The real component of a complex number.

Given a complex number a + bi, the Real property returns the value of a.

The following example instantiates an array of Complex objects and displays the real and imaginary components of each in the form a + bi.


using System;
using System.Numerics;

public class Example
{
   public static void Demo(System.Windows.Controls.TextBlock outputBlock)
   {
      Complex[] values = { new Complex(12.5, -6.3), 
                           new Complex(-17.8, 1.7), 
                           new Complex(14.4, 8.9) };
      foreach (var value in values)
         outputBlock.Text += String.Format("{0} + {1}i", value.Real, value.Imaginary) + "\n";
   }
}
// The example displays the following output:
//       12.5 + -6.3i
//       -17.8 + 1.7i
//       14.4 + 8.9i


Silverlight

Supported in: 5, 4

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.