Announcement

Collapse
No announcement yet.

Math help needed!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Math help needed!

    I'm using this formula in some code i'm writing to get the percent of a number

    Percent = ((( X ) / 272) * 100)-10)


    This formula works. But i need a second formula that solves for x using the same constants... and adding a percent as a constant

    so lets say for example percent = 50.. how would i figure out what the heck x is lol.

    I knew i shouldnt have copied from the smart chick in math class
    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
    Follow Me on Twitter or Facebook
    Live mp3Car Facebook Chat

  • #2
    I'm not exactly sure why you're offsetting the percentage by 10...

    Usually this is the formula:

    % = ( X / TotalItems) * 100

    If we solve for X, we get:

    X = (% * TotalItems) / 100

    So, your formula would be:

    X = (Percent + 10) * 272 / 100

    Is that what you're looking for?
    My Install : '08 Saturn Sky In-dash

    Comment


    • #3
      Originally posted by JackB View Post
      I'm not exactly sure why you're offsetting the percentage by 10...

      Usually this is the formula:

      % = ( X / TotalItems) * 100

      If we solve for X, we get:

      X = (% * TotalItems) / 100

      So, your formula would be:

      X = (Percent + 10) * 272 / 100

      Is that what you're looking for?
      i'm offsetting because the slider is offset by 10. I'll try the formula and let you know the results
      mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
      Follow Me on Twitter or Facebook
      Live mp3Car Facebook Chat

      Comment


      • #4
        Math homework?

        Just change the signs as you bring the numbers across the equals sign.
        Percent = ((( X ) / 272) * 100)-10)
        Percent + 10 = ((x) / 272) * 100)
        Percent + 10 = 100x / 272
        272 * (Percent + 10) = 100x
        272/100 * (Percent + 10) = x
        2.72 * (Percent + 10) = x
        Ampie Case
        2.5" Hard Drive 80GB Samsung 5400RPM
        256 MB DDR2 PC5400
        Xenarc 700TSV - VGA Monitor
        Intel D945GCLF Motherboard
        M2-ATX-HV

        2005 Honda Civic

        Comment


        • #5
          Originally posted by Maheriano View Post
          Math homework?

          Just change the signs as you bring the numbers across the equals sign.
          Percent = ((( X ) / 272) * 100)-10)
          Percent + 10 = ((x) / 272) * 100)
          Percent + 10 = 100x / 272
          272 * (Percent + 10) = 100x
          272/100 * (Percent + 10) = x
          2.72 * (Percent + 10) = x
          Nah not homework.. skin work..and it works! Thanks guys.. had been rattling my brain on that for some time.
          mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
          Follow Me on Twitter or Facebook
          Live mp3Car Facebook Chat

          Comment


          • #6
            Yeah, Maheriano... That's what I said, (basically).

            The 272/100 will be compiled out.

            I enjoy math. Does that make me sick?
            My Install : '08 Saturn Sky In-dash

            Comment


            • #7
              Originally posted by JackB View Post
              Yeah, Maheriano... That's what I said, (basically).

              The 272/100 will be compiled out.

              I enjoy math. Does that make me sick?
              A sadist maybe. I don't know, I do math all day long at work.

              Comment


              • #8
                Originally posted by JackB View Post
                Yeah, Maheriano... That's what I said, (basically).

                The 272/100 will be compiled out.

                I enjoy math. Does that make me sick?
                Great minds think alike! I did it out for him though, so hopefully he'll understand how it works for next time.
                Ampie Case
                2.5" Hard Drive 80GB Samsung 5400RPM
                256 MB DDR2 PC5400
                Xenarc 700TSV - VGA Monitor
                Intel D945GCLF Motherboard
                M2-ATX-HV

                2005 Honda Civic

                Comment


                • #9
                  probably not but at least ill know where to search
                  mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
                  Follow Me on Twitter or Facebook
                  Live mp3Car Facebook Chat

                  Comment


                  • #10
                    Originally posted by Machinehead View Post
                    A sadist maybe. I don't know, I do math all day long at work.
                    Yeah. I write code all day at work. That is almost like doing math.
                    My Install : '08 Saturn Sky In-dash

                    Comment


                    • #11
                      needless to say i still dont get it lol: i've got another slightly different formula i need help with. Same scenario only not dealing with percentages

                      X= ((160 * 2.5)-100) * 0.145

                      in the above function X = 43.5. I need to the solve an equation which gives me X but not "160"... so like this

                      43.5 = ((X * 2.5)-100) * 0.145

                      So how do i solve for X in that second equation
                      mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
                      Follow Me on Twitter or Facebook
                      Live mp3Car Facebook Chat

                      Comment


                      • #12
                        Are you reversing the math? The easiest way to think about it is to break it down and reverse each basic equation.
                        X = n * 2.5 reversed is n = X / 2.5 and keep going...

                        A = 160 * 2.5
                        B = A - 100
                        X = B * 0.145

                        reverse...

                        D = X / 0.145
                        E = D + 100
                        F = E / 2.5

                        So now F = 160

                        Now put it all back together

                        X = ( (43.5 / 0.145) + 100 ) / 2.5

                        Comment


                        • #13
                          well that took me awhile but now i get it. Thanks for the insight Curiosity!
                          mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
                          Follow Me on Twitter or Facebook
                          Live mp3Car Facebook Chat

                          Comment


                          • #14
                            I used to just draw a triangle and put the three numbers inside. 1 number at the top and 2 numbers in the bottom corners. So say you have A at the top, B in the left corner and C in the right corner. You can visually see how the equation changes:
                            A = B * C
                            B = A / C
                            C = A / B
                            I used that for years.
                            Ampie Case
                            2.5" Hard Drive 80GB Samsung 5400RPM
                            256 MB DDR2 PC5400
                            Xenarc 700TSV - VGA Monitor
                            Intel D945GCLF Motherboard
                            M2-ATX-HV

                            2005 Honda Civic

                            Comment


                            • #15
                              In college i majored in Business Admin AND Info technology. If i ever go back i'll major in mathematics lol. I always get caught up with this kinda stuff in my programming.
                              mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
                              Follow Me on Twitter or Facebook
                              Live mp3Car Facebook Chat

                              Comment

                              Working...
                              X