C#计算复利方法

 

复利即是指利滚知利


如存入1000,年利息回0.003,存了答10年,则调用fl(0.003,1000,10);

 

 

double fl(double rate,double cash,int times)
{
double ret = 0;
for (int i = 1; i <= times;i++ )
{
ret += Math.Pow((1 + rate), i);
}
ret *= cash;
return ret;
}

 


posted @ 2020-05-09 00:19  DotNet码农  阅读(601)  评论(0编辑  收藏  举报
/*粒子线条,鼠标移动会以鼠标为中心吸附的特效*/