Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. math namespace

math namespace

Scheduled Pinned Locked Moved C#
csharp
10 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MS Lee
    wrote on last edited by
    #1

    hi ppl i need to use sqrt(), for this i tried to import math namespace but i couldn't get this namespace, but i get math namespace in vb.net.. how could i get math namespace in c#

    self confidence+hard work=SUCCESS

    L D C 3 Replies Last reply
    0
    • M MS Lee

      hi ppl i need to use sqrt(), for this i tried to import math namespace but i couldn't get this namespace, but i get math namespace in vb.net.. how could i get math namespace in c#

      self confidence+hard work=SUCCESS

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      Its not a namespace its a class. Use fully qualified name ie System.Math.

      C isn't that hard: void (*(*f[])())() defines f as an array of unspecified size, of pointers to functions that return pointers to functions that return void "Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live." - Martin Golding

      1 Reply Last reply
      0
      • M MS Lee

        hi ppl i need to use sqrt(), for this i tried to import math namespace but i couldn't get this namespace, but i get math namespace in vb.net.. how could i get math namespace in c#

        self confidence+hard work=SUCCESS

        L Offline
        L Offline
        Lev Danielyan
        wrote on last edited by
        #3

        Check the Math class in System namespace. More specifically Math.Sqrt() static method.

        Regards, Lev

        M 1 Reply Last reply
        0
        • L Lev Danielyan

          Check the Math class in System namespace. More specifically Math.Sqrt() static method.

          Regards, Lev

          M Offline
          M Offline
          MS Lee
          wrote on last edited by
          #4

          yeah i did, but i couldnt get the math class in system.namespace

          self confidence+hard work=SUCCESS

          L 1 Reply Last reply
          0
          • M MS Lee

            yeah i did, but i couldnt get the math class in system.namespace

            self confidence+hard work=SUCCESS

            L Offline
            L Offline
            Lev Danielyan
            wrote on last edited by
            #5

            What do you mean you can't get it? It is definitely there ;) If you mean you can't instantiate it, yes you can't, since it is a static class. Usage: System.Math.Sqrt(100); Actually you can omit "System" since the System namespace is being imported automatically.

            Regards, Lev

            M P 2 Replies Last reply
            0
            • L Lev Danielyan

              What do you mean you can't get it? It is definitely there ;) If you mean you can't instantiate it, yes you can't, since it is a static class. Usage: System.Math.Sqrt(100); Actually you can omit "System" since the System namespace is being imported automatically.

              Regards, Lev

              M Offline
              M Offline
              MS Lee
              wrote on last edited by
              #6

              thanks for your support, i get a system.math.dll file and i import it and its working...:)

              self confidence+hard work=SUCCESS

              G 1 Reply Last reply
              0
              • M MS Lee

                thanks for your support, i get a system.math.dll file and i import it and its working...:)

                self confidence+hard work=SUCCESS

                G Offline
                G Offline
                Guffa
                wrote on last edited by
                #7

                That is not correct. The Math class is in the mscorlib.dll library, which you already have a reference to.

                Despite everything, the person most likely to be fooling you next is yourself.

                1 Reply Last reply
                0
                • M MS Lee

                  hi ppl i need to use sqrt(), for this i tried to import math namespace but i couldn't get this namespace, but i get math namespace in vb.net.. how could i get math namespace in c#

                  self confidence+hard work=SUCCESS

                  C Offline
                  C Offline
                  CPallini
                  wrote on last edited by
                  #8

                  What about documentation [^], [^]? :)

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                  [My articles]

                  1 Reply Last reply
                  0
                  • L Lev Danielyan

                    What do you mean you can't get it? It is definitely there ;) If you mean you can't instantiate it, yes you can't, since it is a static class. Usage: System.Math.Sqrt(100); Actually you can omit "System" since the System namespace is being imported automatically.

                    Regards, Lev

                    P Offline
                    P Offline
                    PIEBALDconsult
                    wrote on last edited by
                    #9

                    Lev Danielyan wrote:

                    the System namespace is being imported automatically.

                    Is it?

                    L 1 Reply Last reply
                    0
                    • P PIEBALDconsult

                      Lev Danielyan wrote:

                      the System namespace is being imported automatically.

                      Is it?

                      L Offline
                      L Offline
                      Lev Danielyan
                      wrote on last edited by
                      #10

                      My fault, I meant that some libs are being referenced automatically (mscorlib.dll for example). But this is not the case here :)

                      Regards, Lev

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups