Reputation: 3
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
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
Upvotes: 1