i wrote "Imports System.Numerics" but it gives me an error

Discussion in 'Visual Basic .Net' started by DN Admin, Apr 13, 2012.

  1. DN Admin

    DN Admin Administrator
    Staff Member

    Country:
    United States
    Joined:
    Aug 7, 2010
    Messages:
    12,048
    Likes Received:
    258
    Location:
    Joliet, IL U.S.A.
    i want to manipulate complex numbers and i followed that link but when i typed
    Imports System.Numerics but it gives an error
    http://msdn.microsoft.com/en-us/library/system.numerics.complex.aspx http://msdn.microsoft.com/en-us/library/system.numerics.complex.aspx
    so how to overcome this problem? http://msdn.microsoft.com/en-us/library/system.numerics.complex.aspx


    Imports System.Numerics<br/>
    <br/>
    Module Example<br/>
    Public Sub Main()<br/>
    ' Create a complex number by calling its class constructor.<br/>
    Dim c1
    As New Complex(12, 6)<br/>
    Console.WriteLine(c1)<br/>
    <br/>
    ' Assign a Double to a complex number.<br/>
    Dim c2
    As Complex = 3.14<br/>
    Console.WriteLine(c2)<br/>
    <br/>
    ' Cast a Decimal to a complex number.<br/>
    Dim c3
    As Complex = CType(12.3d, Complex)<br/>
    Console.WriteLine(c3)<br/>
    <br/>
    ' Assign the return value of a method to a Complex variable.<br/>
    Dim c4
    As Complex = Complex.Pow(Complex.One, -1)<br/>
    Console.WriteLine(c4)<br/>
    <br/>
    ' Assign the value returned by an operator to a Complex variable.<br/>
    Dim c5
    As Complex = Complex.One + Complex.One<br/>
    Console.WriteLine(c5)<br/>
    <br/>
    ' Instantiate a complex number from its polar coordinates.<br/>
    Dim c6
    As Complex = Complex.FromPolarCoordinates(10, .524)<br/>
    Console.WriteLine(c6)<br/>
    End Sub<br/>
    End Module<br/>
    ' The example displays the following output:<br/>
    ' (12, 6)<br/>
    ' (3.14, 0)<br/>
    ' (12.3000001907349, 0)<br/>
    ' (1, 0)<br/>
    ' (2, 0)<br/>
    ' (8.65824721882145, 5.00347430269914)

    View the full article
     

Share This Page