Need help Math formulas for PHP

Discussion in 'PHP' started by anversli, Sep 7, 2010.

  1. #1
    Can someone help me to convert these math formulas into php

    [​IMG]
    [​IMG]
     
    anversli, Sep 7, 2010 IP
  2. cubicaaron

    cubicaaron Guest

    Messages:
    104
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    PHP has a exponent function, called pow - used in the form of pow(x, y) - this results in the mathematical equivalent to x^y
    Therefore, 0.4074% could be achieved by the following, resulting in $result1

    $result1 = pow(1 + 0.05, 1/12);
    Code (markup):
    The second equation is just a longer version of the first; the pow(x, y) will still be used.

    Post what you have so far, in terms of variable names etc, and I'll finish it..
     
    cubicaaron, Sep 8, 2010 IP
  3. cubicaaron

    cubicaaron Guest

    Messages:
    104
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    cubicaaron, Sep 8, 2010 IP
  4. anversli

    anversli Active Member

    Messages:
    350
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #4
    Thank you guys, i was using pow() function but not correctly :)
     
    anversli, Sep 8, 2010 IP
  5. cubicaaron

    cubicaaron Guest

    Messages:
    104
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Just make sure you deal with your result as the right type of variable and you should be fine :)
     
    cubicaaron, Sep 8, 2010 IP