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 Staff Member

    United States
    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/>
    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/>
    ' Assign a Double to a complex number.<br/>
    Dim c2
    As Complex = 3.14<br/>
    ' Cast a Decimal to a complex number.<br/>
    Dim c3
    As Complex = CType(12.3d, Complex)<br/>
    ' Assign the return value of a method to a Complex variable.<br/>
    Dim c4
    As Complex = Complex.Pow(Complex.One, -1)<br/>
    ' Assign the value returned by an operator to a Complex variable.<br/>
    Dim c5
    As Complex = Complex.One + Complex.One<br/>
    ' Instantiate a complex number from its polar coordinates.<br/>
    Dim c6
    As Complex = Complex.FromPolarCoordinates(10, .524)<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