help with Log() function
From: Jon King (jking_at_lioninc.com)
Date: 11/28/03
- Next message: L'Angel Admirable: "Re: Posting a list"
- Previous message: Cf High: "IE6 Session Problem"
- Next in thread: Jason Wong: "Re: [PHP] help with Log() function"
- Reply: Jason Wong: "Re: [PHP] help with Log() function"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: php-general@lists.php.net Date: Fri, 28 Nov 2003 15:03:35 -0700
Hello,
I'm having trouble getting a log formula to work. This forumla is supposed
to return the number of payment required zero out a loan balance.
<!------- snip --------------->
/*
n = - (LN(1-(B/m)*(r/q)))/LN(1+(r/q))
q = amount of annual payment periods
r = interest rate
B = principal
m = payment amount
n = amount payment periods
LN = natural logarithm
*/
$q = 12;
$r = 0.07;
$B = 150000;
$m = 733;
print -(log(1-($B/$m)*($r/$q)))/log(1+($r/$q));
<--- end snip ---->
It keeps returning a NaN. I've checked the syntax over and over, but to no
avail.
Any help would be appreciated
TIA
Jon
- Next message: L'Angel Admirable: "Re: Posting a list"
- Previous message: Cf High: "IE6 Session Problem"
- Next in thread: Jason Wong: "Re: [PHP] help with Log() function"
- Reply: Jason Wong: "Re: [PHP] help with Log() function"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|