Astro
Astro

Reputation: 3

Operations for equivalent interest rates not giving expected result

I am trying to calculate equivalent interest rates like this site and while I believe I wrote all operations correctly I am not getting the same results as the site.

def equivalent_interest_rate(q,r,m):
    return q*((1+(r/m))**(m/q)-1)

print(equivalent_interest_rate(3,12,4))

Does anyone know why this is?

Upvotes: 0

Views: 42

Answers (1)

atune
atune

Reputation: 61

Pay attention to the order and the units.

def equivalent_interest_rate(r,m,q):
    return q*((1+(r/m))**(m/q)-1)

print(equivalent_interest_rate(0.03,12,4))

-> 0.030075062499999028

enter image description here

Upvotes: 1

Related Questions