Click to See Complete Forum and Search --> : Clarification on a calculation


florida
05-15-2003, 09:56 AM
Please explain what this is doing?
I understand it is returning a value and that "myIntRate" is dividing a number but the rest with "(1 - (1/Math.pow(1 + .....))))" I dont understand.

Please advise:

return myLoanTot * (myIntRate / (1 - (1/Math.pow(1 + myIntRate,myPayNums))));

khalidali63
05-15-2003, 10:08 AM
(1 - (1/Math.pow(1 + myIntRate,myPayNums)))

the calculation is happening from right to leftMath.pow returns the exponent power
the 2 parameter

are base,exponent

in the above you are adding 1 to the base

1 + myIntRate
then gettin gthe exponent power for 2 values
this exponent power value then divides 1 and the resultan is deducted from 1..make sense?

florida
05-15-2003, 10:43 AM
Yes, now that you explained it now makes sense!

Thanks!!