Evaluates the interest payment for an investment for a given period.
#include <imsl.h>
float imsl_f_interest_payment (float rate, int period, int n_periods, float present_value, float future_value, int when)
The type double function is imsl_d_interest_payment.
float rate
(Input)
Interest rate.
int period
(Input)
Payment period.
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 see the Usage Notes section of this
chapter.
The interest payment for an investment for a given period. If no result can be computed, NaN is returned.
Function imsl_f_interest_payment computes the interest payment for an investment for a given period.
It is computed using the following:

In this example, imsl_f_interest_payment computes the interest payment for the second year 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 period = 2;
int n_periods = 25;
float present_value = 100000.00;
float future_value = 0.0;
int when = IMSL_AT_END_OF_PERIOD;
float interest_payment;
interest_payment = imsl_f_interest_payment (rate, period, n_periods,
present_value, future_value, when);
printf ("The interest due the second year on the $100,000 ");
printf ("loan is $%.2f.\n", interest_payment);
}
The interest due the second year on the $100,000 loan is $-7890.57.
|
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |