Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.1

Request #8624 Submitted: quickly execution 2006-09-03 13:53 UTC 2007-03-10 07:13 UTC b_j at tar dot hu alejandrop Closed Math_Finance (version 1.0.0) Irrelevant (Not assigned) Your email:

[2006-09-03 13:53 UTC] b_j at tar dot hu (Barczi József)
Description: ------------ Math/Finance.php presentValue: //\$pv = (-\$pmt * (1 + \$rate * \$type) * ((pow(1 + \$rate, \$nper) - 1) / \$rate) - \$fv) / pow(1 + \$rate, \$nper); \$q=pow(1 + \$rate, \$nper); \$pv = (-\$pmt * (1 + \$rate * \$type) * ((\$q - 1) / \$rate) - \$fv) / \$q; futureValue: //\$fv = -\$pv * pow(1 + \$rate, \$nper) - \$pmt * (1 + \$rate * \$type) * (pow(1 + \$rate, \$nper) - 1) / \$rate; \$q=pow(1 + \$rate, \$nper); \$fv = -\$pv * \$q - \$pmt * (1 + \$rate * \$type) * (\$q - 1) / \$rate; payment: //\$pmt = (-\$fv - \$pv * pow(1 + \$rate, \$nper)) / (1 + \$rate * \$type) / ((pow(1 + \$rate, \$nper) - 1) / \$rate); \$q=pow(1 + \$rate, \$nper); //\$pmt = (-\$fv - \$pv * \$q) / (1 + \$rate * \$type) / ((\$q - 1) / \$rate); \$pmt = (-\$fv - \$pv * \$q * \$rate) / ((1 + \$rate * \$type) * (\$q - 1)) ; _tvm: //return \$pv * pow(1 + \$rate, \$nper) + \$pmt * (1 + \$rate * \$type) * (pow(1 + \$rate, \$nper) - 1) / \$rate + \$fv; \$q=pow(1 + \$rate, \$nper); return \$pv * \$q + \$pmt * (1 + \$rate * \$type) * (\$q - 1) / \$rate + \$fv; _dtvm: /* return \$nper * \$pv * pow(1 + \$rate, \$nper - 1) + \$pmt * (\$type * (pow(1 + \$rate, \$nper) - 1) / \$rate + (1 + \$rate * \$type) * (\$nper * \$rate * pow(1 + \$rate, \$nper - 1) - pow(1 + \$rate, \$nper) + 1) / pow(\$rate,2)); */ \$q =pow(1 + \$rate, \$nper); \$q1=pow(1 + \$rate, \$nper - 1); \$q2=pow(\$rate,2); return \$nper * \$pv * \$q1 + \$pmt * (\$type * (\$q - 1) / \$rate + (1 + \$rate * \$type) * (\$nper * \$rate * \$q1 - \$q + 1) / \$q2);