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

    View the full article
     

Share This Page