vj5 Posted October 15, 2007 Report Share Posted October 15, 2007 Can someone please help with a simple sample code to calculate compound interest with explanation? I guess the formula for compound interest is FV=P(1+r) to the number of years. FV is Future Value and P is Principal amount, r is the interest rate. I am not sure if the formula is correct. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 15, 2007 Report Share Posted October 15, 2007 I'm not sure what language you want to do this in, but if you're using Javascript you can use Math.pow for the exponent:http://devguru.com/technologies/javascript/10754.aspPHP has a pow function to do the same thing:http://www.php.net/manual/en/function.pow.phpThere's nothing special to do for multiplication and addition, the + and * operators do those. Link to comment Share on other sites More sharing options...
vj5 Posted October 15, 2007 Author Report Share Posted October 15, 2007 I'm not sure what language you want to do this in, but if you're using Javascript you can use Math.pow for the exponent:http://devguru.com/technologies/javascript/10754.aspPHP has a pow function to do the same thing:http://www.php.net/manual/en/function.pow.phpThere's nothing special to do for multiplication and addition, the + and * operators do those.Thankyou. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now