Re: [PHP] help with Log() function
From: Jason Wong (php-general_at_gremlins.biz)
Date: 11/29/03
- Next message: John Nichel: "Re: [PHP] DAMN"
- Previous message: Rt: "Re: [PHP] DAMN"
- In reply to: Jon King: "help with Log() function"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: php-general@lists.php.net Date: Sat, 29 Nov 2003 14:46:26 +0800
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 */
- Next message: John Nichel: "Re: [PHP] DAMN"
- Previous message: Rt: "Re: [PHP] DAMN"
- In reply to: Jon King: "help with Log() function"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]