Re: help with Log() function
| From: | Jason Wong | Date: | Sat, 29 Nov 2003 06:46:26 +0000 |
| Subject: | Re: help with Log() function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-171342@lists.php.net to get a copy of this message | ||
On Saturday 29 November 2003 06:03, Jon King wrote:
> 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.
> print -(log(1-($B/$m)*($r/$q)))/log(1+($r/$q));
> It keeps returning a NaN. I've checked the syntax over and over, but to no
> avail.
Breakup your calculation into little steps to see where your error lies. Have
to tried entering the above calculation into a real calculator? I believe
your problem is that you cannot log() a negative number.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Algol-60 surely must be regarded as the most important programming language
yet developed.
-- T. Cheatham
*/