CNLMath : Special Functions : principal_payment
principal_payment
Evaluates the payment on the principal for a specified period.
Synopsis
#include <imsl.h>
float imsl_f_principal_payment (float rate, int period, int n_periods, float present_value, float future_value, int when)
The type double function is imsl_d_principal_payment.
Required Arguments
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 when see the Usage Notes section of this chapter.
Return Value
The payment on the principal for a given period. If no result can be computed, NaN is returned.
Description
Function imsl_f_principal_payment computes the payment on the principal for a given period.
It is computed using the following:
where paymenti is computed from imsl_f_payment for the i-th period, interesti is calculated from imsl_f_interest_payment for the i-th period.
Example
In this example, imsl_f_principal_payment computes the principal paid for the first year on a 30-year $100,000 loan with an annual interest rate of 8%. The payment is made at the end of each year.
 
#include <stdio.h>
#include <imsl.h>
 
int main()
{
float rate = .08;
int period = 1;
int n_periods = 30;
float present_value = 100000.00;
float future_value = 0.0;
int when = IMSL_AT_END_OF_PERIOD;
float principal;
 
principal = imsl_f_principal_payment (rate, period, n_periods,
present_value, future_value, when);
printf ("The payment on the principal for the first year of \n");
printf ("the $100,000 loan is $%.2f.\n", principal);
}
Output
 
The payment on the principal for the first year of
the $100,000 loan is $-882.74.