home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / FIN_FUNC.ZIP / FIN_FUNC.PRG next >
Encoding:
Text File  |  1988-09-20  |  4.1 KB  |  102 lines

  1.  
  2. ********************
  3. * Name     FIN_FUNC.PRG
  4. * Author   Lee Thompson
  5. * Notice   Copyright (c) 1988 Lee Thompson
  6. * Date     June 25, 1988
  7. * Updates  August 2, 1988
  8. * Compile  Clipper FIN_FUNC -m
  9. * Link     
  10. * Note     These functions perform identically to functions of
  11. *          the same name as calculated by Lotus 1-2-3, Hewlett-Packard
  12. *          line of business and financial calculators, and others.
  13. ********************
  14.  
  15. FUNCTION PMT                      && Calculates loan payments based on
  16.                                   && given principal, per-period interest
  17.                                   && rate and number of periods/payments
  18.                                   && of loan
  19.  
  20.     PARAMETERS prin, int, term    && prin - principal
  21.                                   && int  - periodic interest rate
  22.                                   && term - number of terms/compounding 
  23.                                   &&        periods/payments 
  24.  
  25.  
  26.  
  27.     RETURN(round(prin * (int/(1-(int+1)**-term)),2))
  28.  
  29.  
  30. **************************
  31.  
  32. FUNCTION PV                       && Calculates the present value of a series
  33.                                   && of equal payments (each of amount, pmt),
  34.                                   && discounted at a periodic interest rate
  35.                                   && (int), over the number of periods (term).
  36.  
  37.     PARAMETERS pmt, int, term
  38.  
  39.  
  40.  
  41.     RETURN(round(pmt * (1-(1+int)**-term)/int,2))
  42.  
  43. *********************
  44.  
  45. FUNCTION TERM                     && Returns the number of payment periods in
  46.                                   && the term of an ordinary annuity necessary
  47.                                   && to accumulate a future value (prin), 
  48.                                   && earning a periodic interest rate (int)
  49.                                   && with equal payments (pmt).
  50.  
  51.                                   && To calculate the number of equal payments
  52.                                   && (pmt) required to payoff/amortize a
  53.                                   && loan amount (prin) at the periodic
  54.                                   && interest rate (int), enter the principal
  55.                                   && loan balance AS A NEGATIVE NUMBER!!!!
  56.  
  57.     PARAMETERS prin, int, pmt
  58.  
  59.     RETURN(ABS(INT(ROUND(LOG(1+(prin*int/pmt))/LOG(1+int),0))))
  60.  
  61. * TERM(100000,.10,2000) returns 19, the number of years it will take to
  62. * accumulate $100,000 at 10% a year, compounded annually, if you deposit
  63. * $2,000 a year into the account.
  64. *
  65. * TERM(-1650000,.1125/12,19013.69) returns 180 indicating that it will take
  66. * 180 monthly payments of $19,013.69 to repay a $1,650,000 loan at the 
  67. * interest rate of of 11.25%.  (For monthly payments, the interest is input
  68. * into the FUNCTION() as 11.25/12/100 to get MONTHLY interest in a decimal
  69. * equivalent.
  70. *
  71. * ALWAYS BE SURE TO EXPRESS THE INTEREST RATE IN THE SAME PERIODIC TERMS AS 
  72. * THE PAYMENTS:  annually, semi-annually, quarterly, monthly, etc.
  73.  
  74. *******************************************
  75.  
  76. FUNCTION FV                       && Returns the future value of an investment
  77.                                   && based on a series of equal payments, each
  78.                                   && of amount pmt, earning periodic interest
  79.                                   && rate (int) for the number of periods in
  80.                                   && term.  FV assumes the investment is an
  81.                                   && ordinary annuity.
  82.  
  83.     PARAMETERS pmt, int, term
  84.  
  85.     RETURN(pmt*((1+int)**term-1)/int)
  86.  
  87. ********************************************
  88.  
  89. FUNCTION FV_ANN_DUE               && Returns the future value of an annuity
  90.                                   && due, i.e., the payment/deposit is made
  91.                                   && on the first day of a compounding period
  92.                                   && rather than the last day as in an ordinary
  93.                                   && annuity.
  94.  
  95.     PARAMETERS pmt, int, term
  96.  
  97.     RETURN((pmt*((1+int)**term-1)/int)*(1+int))
  98.  
  99. *********************************************
  100. *EOF - FIN_FUNC.PRG/ljt
  101. *********************************************
  102.