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

    Staff Member

    Country:
    United States
    Joined:
    Aug 7, 2010
    Location:
    Joliet, IL U.S.A.
    i want to manipulate complex numbers and i followed that link but when i typed
    <span style="color:blue Imports</span> 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


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

    View the full article
     
    #1

Share This Page