Evaluates the periodic payment for an investment.
#include <imsl.h>
float imsl_f_payment (float rate, int n_periods, float present_value, float future_value, int when)
The type double function is imsl_d_payment.
float rate
(Input)
Interest rate.
int n_periods
(Input)
Total number of periods.
float
present_value (Input)
The current value of a stream of
future payments, after discounting the payments using some interest rate.
float
future_value (Input)
The value, at some time in the
future, of a current amount and a stream of payments.
int when
(Input)
Time in each period when the payment is made, either IMSL_AT_END_OF_PERIOD
or IMSL_AT_BEGINNING_OF_PERIOD.
For a more detailed discussion on when see the Usage
Notes section of this chapter.
The periodic payment for an investment. If no result can be computed, NaN is returned.
Function imsl_f_payment computes the periodic payment for an investment.
It can be found by solving the following:
If rate = 0

If rate ¹ 0

In this example, imsl_f_payment computes the periodic payment of a 25-year $100,000 loan with an annual interest rate of 8%. The payment is made at the end of each period.
#include <stdio.h>
#include "imsl.h"
void main()
{
float rate = .08;
int n_periods = 25;
float present_value = 100000.00;
float future_value = 0.0;
int when = IMSL_AT_END_OF_PERIOD;
float payment;
payment = imsl_f_payment (rate, n_periods, present_value,
future_value, when);
printf ("The payment due each year on the $100,000 ");
printf ("loan is $%.2f.\n", payment);
}
The payment due each year on the $100,000 loan is $-9367.88.
|
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |