|
-
Dec 16th, 2010, 04:13 AM
#1
Thread Starter
Lively Member
Math.pow
Can someone please explain Math.pow to me?
I have this formula for compound interest and my question is, is year the only exponent even though 1 + rate, year are all in the ()?
Also could you explain the formula to me? i just cant wrap my head around it. Why do you add 1 and why is it exponential?
Code:
amount=principal*Math.pow(1 + rate, year);
Last edited by OT²O; Dec 16th, 2010 at 08:31 PM.
On the off chance that I helped you ( Rate This Post){
Also If your problem was resolved;
}
-
Dec 16th, 2010, 08:00 AM
#2
Re: Math.pow
Check this link: http://math.about.com/library/weekly/aa042002a.htm
This is how it looks like:
Code:
amount=principal*((1+rate)^year)
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Dec 16th, 2010, 06:29 PM
#3
Thread Starter
Lively Member
Re: Math.pow
Yeah that's what i thought but why when you use math pow you have to enter two parts separated by a comma and only one of them is the actual exponent? Like in this example 1+rate is not an exponent but it is in the math.pow but year is an exponent?
Code:
Math.pow(1 + rate, year);
On the off chance that I helped you ( Rate This Post){
Also If your problem was resolved;
}
-
Dec 16th, 2010, 08:23 PM
#4
Re: Math.pow
 Originally Posted by OT²O
Yeah that's what i thought but why when you use math pow you have to enter two parts separated by a comma and only one of them is the actual exponent? Like in this example 1+rate is not an exponent but it is in the math.pow but year is an exponent?
Code:
Math.pow(1 + rate, year);
pow is a function of the math object. Pow requires 2 arguments, the first being a double for the base number and the second being the number of the exponent.
So Math.pow(8,3) would be the same as 8^3
http://download.oracle.com/javase/1....e,%20double%29
-
Dec 16th, 2010, 08:30 PM
#5
Thread Starter
Lively Member
Re: Math.pow
 Originally Posted by kfcSmitty
That makes perfect sense thank you.
On the off chance that I helped you ( Rate This Post){
Also If your problem was resolved;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|