payment
Evaluates the periodic payment for an investment.
Synopsis
#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.
Required Arguments
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.
Return Value
The periodic payment for an investment. If no result can be computed, NaN is returned.
Description
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
Example
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>
int 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);
}
Output
The payment due each year on the $100,000 loan is $-9367.88.