Path: utzoo!censor!comspec!humvax!becker!ncrcan!attcan!uunet!bu.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hpda!hpcupt1!jog From: jog@hpcupt1.cup.hp.com (Rajeev Jog) Newsgroups: alt.sources.wanted Subject: Re: Re: mortgage program Message-ID: <-283049998@hpcupt1.cup.hp.com> Date: 7 Jan 91 19:58:11 GMT References: <1991Jan3.194905.247@ee.rochester.edu> Organization: Hewlett-Packard, Cupertino Lines: 38 > / hpcupt1:alt.sources.wanted / laird@chinet.chi.il.us (Laird J. Heal) / 3:22 am Jan 4, 1991 / > >Does anyone has a source program for mortgage payment calculations? I like > >to run it on my IBM PC...please e-mail the program...thanks! > > Well, I make a habit of deriving the formula every so often - not on the net > before, so here goes: > > P=principal, n=number of payments, i=interest, x=payment: > > really the one: given the monthly payment I can afford > and the price/interest-rate I am facing, how long will > it take to make to payoff? > > as x=Pi((1+i)**n)/(1 - (1+i)**n) > x - x(1+i)**n = Pi(1+i)**n > x=(Pi+x)(1+i)**n > x/(Pi+x)=(1+i)**n > n=(log(x/(Pi+x)))/log(1+i) > > Now maybe if I get really ambitious I will put together > a little bit of scanf() and printf() and...nah. > -- > Laird J. Heal The Usenet is dead! > Here: laird@chinet.chi.il.us Long Live the Usenet! Might help to try all the scanf(), and printf() and actually use it; For all positive x, P, and i, the formula n= (log (x / (Pi+x)) ) / log(1+i) above yields a negative numerator and a positive denominator, hence a negative number of payments. I wish the same were true of my mortgage. Rajeev Jog ******************************************************************************* Hardware Systems Performance * voice : +1 408 447 0220 Hewlett-Packard * e-mail: jog@hpda.cup.HP.COM 19447 Pruneridge Avenue, MS 42LX * jog%hpda@hplabs.HP.COM Cupertino, CA. 95014-9974 USA * fax : +1 408 447 4907 *******************************************************************************