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. Dummy Math Questions

Dummy Math Questions

Scheduled Pinned Locked Moved C#
questioncsharphelptutorial
11 Posts 4 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
    matthias s 0
    wrote on last edited by
    #1

    hello, i'm trying to cope with a couple of math calculations i need to do within my c# application. i've got two problems: first, i have difficulties translating the vocabulary to english and second, i don't know how to code it in c#. two things i require: 1. how do I get the root of n? 2. how do I calculate the reciprocal of a number? and what is the reciprocal anyway? and yes, i've been to school. but this is a long time ago. thanks for your help!

    /matthias

    I love deadlines. I like the whooshing sound they make as they fly by.
    [Douglas Adams]

    G 1 Reply Last reply
    0
    • M matthias s 0

      hello, i'm trying to cope with a couple of math calculations i need to do within my c# application. i've got two problems: first, i have difficulties translating the vocabulary to english and second, i don't know how to code it in c#. two things i require: 1. how do I get the root of n? 2. how do I calculate the reciprocal of a number? and what is the reciprocal anyway? and yes, i've been to school. but this is a long time ago. thanks for your help!

      /matthias

      I love deadlines. I like the whooshing sound they make as they fly by.
      [Douglas Adams]

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      matthias s. wrote:

      how do I get the root of n?

      You can use Math.Pow method

      matthias s. wrote:

      how do I calculate the reciprocal of a number?

      matthias s. wrote:

      and what is the reciprocal anyway?

      Well I believe first you have to find out what reciprocal is and then start coding it. So why don;t you google?

      M 1 Reply Last reply
      0
      • G Giorgi Dalakishvili

        matthias s. wrote:

        how do I get the root of n?

        You can use Math.Pow method

        matthias s. wrote:

        how do I calculate the reciprocal of a number?

        matthias s. wrote:

        and what is the reciprocal anyway?

        Well I believe first you have to find out what reciprocal is and then start coding it. So why don;t you google?

        M Offline
        M Offline
        matthias s 0
        wrote on last edited by
        #3

        thanks for your help on the first part. ad google: i did. but still, i don't understand what i've found. the explanations are cluttered with different approaches on how to deal with reciprocal - this is why i asked. to clear things up a little, I'd like to mention, that I'm trying to do what is written here: "To convert this value to ordinary 'Shutter Speed'; calculate this value's power of 2, then reciprocal." i'm just in need of a simple answer of somebody, who shares a household with reciprocal and c# ;)

        /matthias

        I love deadlines. I like the whooshing sound they make as they fly by.
        [Douglas Adams]

        G S CPalliniC 3 Replies Last reply
        0
        • M matthias s 0

          thanks for your help on the first part. ad google: i did. but still, i don't understand what i've found. the explanations are cluttered with different approaches on how to deal with reciprocal - this is why i asked. to clear things up a little, I'd like to mention, that I'm trying to do what is written here: "To convert this value to ordinary 'Shutter Speed'; calculate this value's power of 2, then reciprocal." i'm just in need of a simple answer of somebody, who shares a household with reciprocal and c# ;)

          /matthias

          I love deadlines. I like the whooshing sound they make as they fly by.
          [Douglas Adams]

          G Offline
          G Offline
          Giorgi Dalakishvili
          wrote on last edited by
          #4

          Here is the definition of reciprocal: http://www.mathleague.com/help/fractions/fractions.htm#reciprocal

          1 Reply Last reply
          0
          • M matthias s 0

            thanks for your help on the first part. ad google: i did. but still, i don't understand what i've found. the explanations are cluttered with different approaches on how to deal with reciprocal - this is why i asked. to clear things up a little, I'd like to mention, that I'm trying to do what is written here: "To convert this value to ordinary 'Shutter Speed'; calculate this value's power of 2, then reciprocal." i'm just in need of a simple answer of somebody, who shares a household with reciprocal and c# ;)

            /matthias

            I love deadlines. I like the whooshing sound they make as they fly by.
            [Douglas Adams]

            S Offline
            S Offline
            StevenBee
            wrote on last edited by
            #5

            http://en.wikipedia.org/wiki/Reciprocal\_(mathematics) 1/X so you would take the shutter speed, square it, then divide 1 by it.

            1 Reply Last reply
            0
            • M matthias s 0

              thanks for your help on the first part. ad google: i did. but still, i don't understand what i've found. the explanations are cluttered with different approaches on how to deal with reciprocal - this is why i asked. to clear things up a little, I'd like to mention, that I'm trying to do what is written here: "To convert this value to ordinary 'Shutter Speed'; calculate this value's power of 2, then reciprocal." i'm just in need of a simple answer of somebody, who shares a household with reciprocal and c# ;)

              /matthias

              I love deadlines. I like the whooshing sound they make as they fly by.
              [Douglas Adams]

              CPalliniC Offline
              CPalliniC Offline
              CPallini
              wrote on last edited by
              #6

              For reciprocal see here [^]. And of course you don't need Pow to take the square of a number, just multiply it by itself. Perhaps what you need is:

              ShutterSpeed = 1.0/(OriginalValue*OriginalValue);

              Please note that some care must be taken when OriginalValue approaches zero... :)

              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.

              In testa che avete, signor di Ceprano?

              S G M 3 Replies Last reply
              0
              • CPalliniC CPallini

                For reciprocal see here [^]. And of course you don't need Pow to take the square of a number, just multiply it by itself. Perhaps what you need is:

                ShutterSpeed = 1.0/(OriginalValue*OriginalValue);

                Please note that some care must be taken when OriginalValue approaches zero... :)

                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.

                S Offline
                S Offline
                StevenBee
                wrote on last edited by
                #7

                Maybe wrap it in a if (OriginalValue != 0) { } test.

                CPalliniC 1 Reply Last reply
                0
                • CPalliniC CPallini

                  For reciprocal see here [^]. And of course you don't need Pow to take the square of a number, just multiply it by itself. Perhaps what you need is:

                  ShutterSpeed = 1.0/(OriginalValue*OriginalValue);

                  Please note that some care must be taken when OriginalValue approaches zero... :)

                  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.

                  G Offline
                  G Offline
                  Giorgi Dalakishvili
                  wrote on last edited by
                  #8

                  CPallini wrote:

                  And of course you don't need Pow to take the square of a number, just multiply it by itself.

                  I thought he meant n-th root from number :)

                  1 Reply Last reply
                  0
                  • S StevenBee

                    Maybe wrap it in a if (OriginalValue != 0) { } test.

                    CPalliniC Offline
                    CPalliniC Offline
                    CPallini
                    wrote on last edited by
                    #9

                    StevenBee wrote:

                    if (OriginalValue != 0) { }

                    Maybe you still got a divide by zero exception! :-D

                    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.

                    In testa che avete, signor di Ceprano?

                    1 Reply Last reply
                    0
                    • CPalliniC CPallini

                      For reciprocal see here [^]. And of course you don't need Pow to take the square of a number, just multiply it by itself. Perhaps what you need is:

                      ShutterSpeed = 1.0/(OriginalValue*OriginalValue);

                      Please note that some care must be taken when OriginalValue approaches zero... :)

                      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.

                      M Offline
                      M Offline
                      matthias s 0
                      wrote on last edited by
                      #10

                      thanks a lot. i'll try that tonight.

                      /matthias

                      I love deadlines. I like the whooshing sound they make as they fly by.
                      [Douglas Adams]

                      CPalliniC 1 Reply Last reply
                      0
                      • M matthias s 0

                        thanks a lot. i'll try that tonight.

                        /matthias

                        I love deadlines. I like the whooshing sound they make as they fly by.
                        [Douglas Adams]

                        CPalliniC Offline
                        CPalliniC Offline
                        CPallini
                        wrote on last edited by
                        #11

                        So...Have a nice night! :-D

                        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.

                        In testa che avete, signor di Ceprano?

                        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