I suck at math I know but I think it's the power that's screwing me up. I can't seem to translate it properly into C++. This is the equation:
( r ( 1 + r )^n )
P = ------------------------ * L
(( 1 + r )^n – 1)
This is how I wrote it:
double P = (1+r)* pow ((1+r),n)/((1+r)* pow ((1+r),n)-1)*L;