algorithms

Discussion in 'Microsoft VC .NET' started by Guest, Feb 1, 2005.

  1. Guest

    Guest Guest

    I need help!!!
    What should i do if i want to get out r from this function where i already
    have a and b.

    (1-(1/(1+r))^b)/r=a is there any logarithm and if there is in what library
    do i find it
     
    Guest, Feb 1, 2005
    #1
    1. Advertisements

  2. "Lembit" <> wrote in message
    news:...
    > I need help!!!
    > What should i do if i want to get out r from this function where i already
    > have a and b.
    >
    > (1-(1/(1+r))^b)/r=a is there any logarithm and if there is in what library
    > do i find it


    I think this is correct. Check it.

    (1-(1/(1+r))^b)/r=a
    (1-(1/(1+r))^b)=a*r
    1-(1/(1+r)) = (a*r)^(1/b)
    -1/(1+r) = (a*r)^(1/b)-1
    1/(1+r) = -((a*r)^(1/b)-1)
    1+r = 1/(-((a*r)^(1/b)-1))
    r = 1/(-((a*r)^(1/b)-1))-1

    /Fredrik
     
    Fredrik Wahlgren, Feb 1, 2005
    #2
    1. Advertisements

  3. "Fredrik Wahlgren" <> wrote in message
    news:%...
    >
    > "Lembit" <> wrote in message
    > news:...
    > > I need help!!!
    > > What should i do if i want to get out r from this function where i

    already
    > > have a and b.
    > >
    > > (1-(1/(1+r))^b)/r=a is there any logarithm and if there is in what

    library
    > > do i find it

    >

    Forget my previous reply
     
    Fredrik Wahlgren, Feb 1, 2005
    #3
  4. Lembit wrote:
    > I need help!!!
    > What should i do if i want to get out r from this function where i
    > already have a and b.
    >
    > (1-(1/(1+r))^b)/r=a is there any logarithm and if there is in what
    > library do i find it


    I'm too lazy to attempt the algebra at the moment, but looking at it, I'd
    say no, there is no formula for that value - you'll have to use numerical
    methods to search for a suitable r for a given a and b. For example, you
    might use "Newton's Method" to solve this. You'll likely have to look it up
    in a numerical methods book or a calculus book.

    -cd
     
    Carl Daniel [VC++ MVP], Feb 2, 2005
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page