02c04-4.php
来自「介绍PHP5的给类型函数应用」· PHP 代码 · 共 17 行
PHP
17 行
<?php// Calculating Continuous Compound Interest:// a = the initial amount you are calculating from// r = the annual percentage rate// y = the number of years you wish to calculate this for:function calc_continuous_compound_interest($a, $r, $y) { return $a * pow(M_E, $r * $y);}// Calculate the value of $5000, at 3.25% interest, compounded daily, // for 3 years. Answer: 5512.0572078166echo calc_continuous_compound_interest(5000, .0325, 3), '<br />';// Calculate the value of $1000, at 8.5% interest, compounded monthly,// for 6 months. Answer: 1043.4160563737echo calc_continuous_compound_interest(1000, .085, .5);?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?