help with Log() function

From: Jon King (jking_at_lioninc.com)
Date: 11/28/03


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



Relevant Pages

  • Re: Calculating mortgage payments
    ... mortgage, which looks like being only a few years before I switch. ... Both assume that you actually pay ... One method assumes that if, say, the amount outstanding at ... them back, taking into account the time at which each payment is made, ...
    (uk.finance)
  • Re: How are STRIPS for lottery jackpots taxed?
    ... How are STRIPS for lottery jackpots taxed? ... the amount actually received for any payment. ... to include an item in income even though the taxpayer has not yet received ...
    (misc.taxes)
  • Re: Date/If function for past dues
    ... Seems to me that a payment is due ... > THe data that is on sheet 2 is below with column headings. ... > Date Amount Cr. ... this borrower is not past due. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Help: please send me terms of your loan
    ... Loan balance before the period or series of periods. ... Payment frequency. ... beginning and ending balance, amount of payment, ...
    (microsoft.public.excel.misc)
  • Re: Mikrofonen.se ripped me off
    ... As an academician who publishes a fair amount as part of my career, ... Regards, Ty Ford" ... However I have no funds to make any payment." ...
    (rec.audio.pro)